Skip to content

Claude/implement cortex workflow 016c v bki ft pg9 v273 v2 sc hrj#1

Open
0xSero wants to merge 2 commits intodevfrom
claude/implement-cortex-workflow-016cVBkiFtPg9V273V2SCHrj
Open

Claude/implement cortex workflow 016c v bki ft pg9 v273 v2 sc hrj#1
0xSero wants to merge 2 commits intodevfrom
claude/implement-cortex-workflow-016cVBkiFtPg9V273V2SCHrj

Conversation

@0xSero
Copy link
Owner

@0xSero 0xSero commented Dec 13, 2025

No description provided.

Adds a sophisticated AI orchestration system that separates context
management from task execution using two concurrent models:

- Model A (Context Manager): Orchestrates context, manages memory graphs,
  selects relevant tools, and prepares curated input for the worker model
- Model B (Worker Model): Executes tasks with a clean, focused context
  containing only necessary tools and information

Key components:
- CortexTypes: Comprehensive type definitions for the system
- MemoryGraph: In-memory graph database for context storage and retrieval
- ToolSelector: Intelligent tool selection algorithm based on intent analysis
- CortexWorker: Worker execution wrapper for Model B
- CortexOrchestrator: Core orchestration logic for Model A
- CortexSession: Integration with OpenCode session system
- cortex agent: New agent configuration for Cortex mode
- CortexStatus UI: TUI component showing workflow state and metrics

Features:
- Intent analysis with capability detection
- Semantic memory search with relevance scoring
- Automatic tool dependency resolution
- Multiple operational modes (single-task, multi-task, iterative)
- Memory graph pruning and persistence
- Real-time progress events and metrics

Tests:
- Memory graph unit tests
- Tool selector unit tests
- Orchestrator and type validation tests
…ibility

- Add comprehensive token tracking with cache read/write and reasoning tokens
- Integrate with Permission system for recoverable error handling
- Add extensive Bus events for real-time UI updates:
  - PhaseChanged with previousPhase tracking
  - TaskStarted/TaskCompleted with task counts
  - TaskProgress for real-time tool call visibility
  - MetricsUpdated for live cost/token tracking
  - MemoryUpdated for entity count tracking
  - OrchestrationComplete with full summary
  - Error events with recovery information
- Add performance utilities:
  - getPerformanceMetrics for detailed analysis
  - getStatus for real-time orchestration status
  - subscribe() for convenient event listening
- Enhance UI component:
  - Display cache tokens (read/write)
  - Display reasoning tokens
  - Show per-task cost
  - Improved token row styling
- Add comprehensive documentation (README.md)
- Update tests for new token structure

Integrates with Decimal.js for precise cost calculation and follows
existing Session.getUsage patterns for token/cost tracking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants