feat(orchestration): wire DagScheduler into /plan confirm flow#1458
Merged
feat(orchestration): wire DagScheduler into /plan confirm flow#1458
Conversation
- Replace stub aggregation in handle_plan_confirm with full DagScheduler tick loop: Spawn -> spawn_for_task(), Cancel -> manager.cancel(), Done -> LlmAggregator::aggregate() - Extract run_scheduler_loop(), process_pending_secret_requests(), finalize_plan_execution() helpers for clarity - Fix handle_plan_list to show pending graph summary instead of always returning "No recent plans" - Fix handle_plan_retry to reset stale Running tasks to Ready and clear assigned_agent before re-execution - Add pre-validation before DagScheduler constructor to preserve graph on predictable failures (empty tasks, terminal status) - Use tokio::select! with 120s timeout on secret request bridging to avoid blocking the tick loop indefinitely - Add spawn_counter for accurate sequential progress messages - Truncate task error output to 500 chars in failure summary - Increment tasks_completed/tasks_failed orchestration metrics - Add 8 unit tests covering no-manager fallback, no-pending-graph, completed/failed graph paths, plan list, and retry reset Fixes: #1434 Related: #1454, #1455, #1456, #1457 (follow-up issues filed)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1434 —
/plan confirmnow executes the task graph throughDagSchedulerbefore aggregating results.DagSchedulertick loop intohandle_plan_confirm(): tasks execute viaSubAgentManager::spawn_for_task(), secret requests are bridged with 120s timeout, results aggregated byLlmAggregatoron completionhandle_plan_list()— always returned "No recent plans" even with a pending graphhandle_plan_retry()— staleRunningtasks now reset toReadywith clearedassigned_agentbefore re-executionDagSchedulerconstructor to preserve it on failuretasks_completed/tasks_failedorchestration metrics on plan completionTest plan
cargo nextest run --workspace --features full --lib --bins— 4886 passed, 0 failurescargo clippy --workspace --features full -- -D warnings— cleancargo +nightly fmt --check— cleanFollow-up issues filed
/plan cancelduring active execution (known limitation documented in code)