Operator dashboard cost ignores agent-reported ACP

Task 10025 · Done · Coder · created · updated

`apps/api/app/operator_dashboard/cost.py::load_cost_facts` prices every session entry's `usage_by_model` with `capture_cost` and never reads `reported_cost_usd`. So for an ACP session, the dashboard figure disagrees with the task's run-metrics cost, which breaks the module's own AC4.1 claim that a one-task slice equals run metrics: - For a session with a cumulative agent-reported cost, the dashboard prices tokens that the agent's total already covers. Task 9952 made `model_prices.prices_tokens` the rule for this case. - For a session with per-turn reported costs, those costs are left out entirely. Requirements: - In `load_cost_facts`, for an entry where `prices_tokens(entry)` is false, keep its token facts but do not price them. - Add one USD fact per session entry for its `reported_cost_usd`. Keep the session's date and attributes. Out of scope: run metrics, Efficiency, and node-side ACP normalisation. Done means: - An apps/api test shows that a one-task dashboard slice equals `run_aggregates` for that task when the task has a cumulative-cost ACP session and when it has a per-turn reported-cost session. - `./dc check quick` is green.

Outcome

Dashboard cost now skips pricing tokens a cumulative ACP total covers and adds each session's reported_cost_usd; one-task slice equals run_aggregates (new test, both cases). Quick gate green; PR #6905 queued to merge lane. Memory: none applied.

Pull request

Artifacts

Activity

  • Created
  • Run
  • Runner started
  • Runner ended (done)