Skip to content

feat: count tasks completed before cancellation in orchestration metrics #1612

@bug-ops

Description

@bug-ops

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions