Skip to content

Commit f870e2c

Browse files
echobtfactorydroid
andauthored
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

File tree

cortex-agents/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,11 @@ pub use collab::{
167167

168168
// Re-export task types
169169
pub use task::{
170-
DagBuilder, DagError, DagHydrator, DagResult, DagStore, InMemoryDagStore, PersistenceError,
171-
SerializedDag, Task, TaskDag, TaskId, TaskSpec, TaskStatus,
170+
execute_dag, DagBuilder, DagError, DagHydrator, DagResult, DagStore, ExecutionProgress,
171+
ExecutorConfig, ExecutorError, ExecutorResult, InMemoryDagStore, PersistenceError,
172+
SerializedDag, SessionHydrationError, SessionHydrationResult, SessionHydrator,
173+
SessionRestoreConfig, StaleTaskChecker, StaleTaskInfo, Task, TaskDag, TaskExecutionResult,
174+
TaskExecutor, TaskId, TaskSpec, TaskStatus, TaskStore,
172175
};
173176

174177
// Re-export routing types

0 commit comments

Comments
 (0)