Add cost accounting and per-task cost aggregation

t-587.7·WorkTask·
·
·
·Omni/Ide.hs
Parent:t-587·Created1 week ago·Updated1 week ago

Description

Edit

Add cost accounting and per-task cost aggregation.

Track cumulative cost across all agentd runs for a given task, so we can see how much each task costs to develop/review/integrate.

Implement: 1. After each agentd run completes, extract cost from agentd status <run-id> --json (check what fields are available). 2. Add a task comment with the run cost: "Run dev-t-575-... cost: $X.XX" 3. Optionally add a task cost <id> CLI subcommand that sums all cost comments for a task. 4. Add cumulative cost to the loop's log output. 5. Add --max-task-cost CENTS flag: if cumulative cost for a single task exceeds this, stop retrying and mark as needs-human-attention.

This is lower priority since the provider is buffet-priced, but useful for understanding system efficiency and detecting runaway tasks.

Files: Omni/Ide/dev-review-release.sh, optionally Omni/Task.hs

Timeline (14)

🔄[human]Open → InProgress1 week ago
💬[human]1 week ago

Implemented per-run cost accounting and cumulative task budget cap in commit e4204bcf. Added run cost comments (, cumulative), loop logging, guard, and needs-help escalation when over budget; docs updated.

🔄[human]InProgress → Review1 week ago
💬[human]1 week ago

Implemented per-run cost accounting and cumulative task budget cap in commit e4204bcf.

Changes:

  • records run cost comments with cost_cents= and cumulative metadata
  • logs run + cumulative cost after each agentd execution
  • adds --max-task-cost guard for per-task cumulative spend
  • marks over-budget tasks as needs-help with explanatory comment
  • updates README + DEV_REVIEW_RELEASE docs
💬[human]1 week ago

Manual review due recurring CostExhausted in workflow review runs. Verified with shellcheck/bash syntax and runtime probes: status/dashboard still works, cost comments are emitted after runs, and path now escalates to needs-help when limit exceeded.

🔄[human]Review → Approved1 week ago
💬[human]1 week ago

Manual review due recurring CostExhausted in workflow review runs.

Verified:

  • bash -n Omni/Ide/dev-review-release.sh
  • lint Omni/Ide/dev-review-release.sh
  • dashboard commands continue to function (status + status --json)
  • over-budget branch (--max-task-cost) escalates task to needs-help and avoids further automation attempts
💬[human]1 week ago

Integrated commit e4204bcf onto live as e38a181b (manual integration path due provider budget exhaustion in workflow agents).

🔄[human]Approved → Done1 week ago