Commit f870e2c
feat(agents): implement task DAG executor with parallel execution (#413)
Implement the full Task DAG execution system for multi-agent workflows:
## TaskExecutor (cortex-agents/src/task/executor.rs)
- Parallel execution of independent tasks with configurable concurrency
- Respects DAG dependencies - tasks only start when dependencies complete
- File conflict detection to prevent parallel access to same files
- Progress tracking with completion percentage
- Cancellation support
- Configurable fail-fast or continue-on-failure modes
- Per-task and overall timeout support
- Automatic persistence of DAG state during execution
- Integration with both InMemoryDagStore and DagStore backends
## Session Hydration (cortex-agents/src/task/hydration.rs)
- SessionHydrator for restoring DAG state between CLI sessions
- Automatic reset of running tasks to pending on restore
- StaleTaskChecker for detecting when files were modified since task completion
- SessionRestoreConfig for configurable restoration behavior
## New Exports
- ExecutorConfig, ExecutorError, ExecutorResult, ExecutionProgress
- TaskExecutor, TaskExecutionResult, TaskStore trait
- SessionHydrator, SessionHydrationError, SessionHydrationResult
- StaleTaskChecker, StaleTaskInfo, SessionRestoreConfig
- execute_dag() convenience function
Includes 40 passing tests covering:
- Parallel execution behavior
- Dependency ordering
- Fail-fast and continue-on-failure modes
- Task timeouts
- File conflict detection
- Cancellation
- Progress tracking
- Persistence during execution
Co-authored-by: Droid Agent <droid@factory.ai>1 parent 07914c1 commit f870e2c
4 files changed
Lines changed: 1266 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
| |||
0 commit comments