Commit f6eede2
committed
feat(cortex-agents): implement multi-agent collaboration system
Implements AGENT_1 mission from ORCHESTRATE plan:
## Collaboration Module (collab/)
- spawn_agent: Create subagents with depth limit enforcement
- send_input: Inter-agent communication with interrupt support
- wait: Synchronize on multiple agents with configurable timeout
- close_agent: Graceful shutdown with RAII guards
## Task DAG Module (task/)
- TaskDag: Directed acyclic graph for task dependencies
- Topological sort for execution ordering
- Status propagation (completion unlocks dependents, failure skips)
- Persistence: Save/load DAG state to JSON
- Hydration: Create DAGs from task specifications
## Routing Module (routing/)
- DispatchMode: Parallel, Sequential, Background, Single
- decide_routing: Automatic dispatch mode selection
- File conflict detection for safe parallel execution
- Priority-based execution ordering
## Security Features
- MAX_THREAD_SPAWN_DEPTH = 1 (prevents infinite recursion)
- MAX_CONCURRENT_AGENTS = 10
- Timeout clamping (10s min, 5min max)
- AgentGuard for automatic cleanup
All 92 tests passing.1 parent e2e48f1 commit f6eede2
14 files changed
Lines changed: 4271 additions & 0 deletions
File tree
- cortex-agents
- src
- collab
- task
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
0 commit comments