Context
finalize_plan_execution() handles GraphStatus::Canceled (added in #1603) but does not update orchestration metrics (m.orchestration.tasks_completed). The GraphStatus::Completed arm increments this counter correctly, but the Canceled arm does not count tasks that were completed before cancellation.
Impact
Low — metrics will under-report completed tasks when a plan is canceled mid-execution. Relevant for: TUI metrics panel, cost tracking, observability.
Acceptance criteria
In the GraphStatus::Canceled arm of finalize_plan_execution():
- Count tasks with
TaskStatus::Completed
- Call
self.update_metrics(|m| m.orchestration.tasks_completed += completed_count)
Labels
enhancement, observability
Context
finalize_plan_execution()handlesGraphStatus::Canceled(added in #1603) but does not update orchestration metrics (m.orchestration.tasks_completed). TheGraphStatus::Completedarm increments this counter correctly, but the Canceled arm does not count tasks that were completed before cancellation.Impact
Low — metrics will under-report completed tasks when a plan is canceled mid-execution. Relevant for: TUI metrics panel, cost tracking, observability.
Acceptance criteria
In the
GraphStatus::Canceledarm offinalize_plan_execution():TaskStatus::Completedself.update_metrics(|m| m.orchestration.tasks_completed += completed_count)Labels
enhancement, observability