Repository navigation
Description
Priority
P2
Type
UX / Bug (analytics honesty)
Problem
The thread panel's new Cost total (#4360) presents subscription work as money spent:
- A Claude Code thread on a Pro/Max login shows the cost Claude Code writes into its log (an API-equivalent figure), with the tip "As the harness reported it". On the audit machine, subscription logins
paral-2andpersonal-1hold $300.75 and $172.05 ofcost_usd. - A Codex thread on a ChatGPT sign-in reports no cost, so the panel prices its tokens at list price and shows
~$x"Partly estimated from tokens at list price", althoughdocs/data-store.mdstates a ChatGPT sign-in is not billed per token.
The Statistics page already carries the caveat ("not necessarily what a subscription bills"), so the app is inconsistent, and the audit brief requires no invented costs for subscriptions.
Current implementation
apps/desktop/src/ui/threadTotals.tsturnCost/threadTotals: reported cost, elseestimateUsd.apps/desktop/src/ui/ThreadDetails.tsx:239-249: label "Cost" and its tip.apps/desktop/src/ui/StatisticsPage.tsx:514and:955: the existing subscription caveat.- Sign-in kind is already known to the engine:
rustcode/engine/src/harness/detect.rsparsesclaude auth status --json(authMethod:claude.aivsapi_key) andcodex login status("Logged in using ChatGPT");provider_auth/claude_usage.rs:564readssubscriptionType.
Evidence
Verified in source; dollar totals from rc data query "select harness, account, sum(cost_usd) from turns group by 1,2" on the audit machine. Whether Claude Code's logged cost is API-equivalent for subscription logins is documented by Anthropic for total_cost_usd; treat as high-confidence, not verified against a bill.
Proposed improvement
- Engine: add
billing: "subscription" | "api" | "unknown"to each harness and account in_rustcode/harnesses(from the status probes it already runs; built-in profiles areapiunless plan-backed). - Desktop: for a thread whose harness/account is
subscription, label the total "API value" (tip: "What these tokens would cost at API prices. Your subscription is billed separately.") and never show a list-price estimate as "Cost";unknownkeeps today's wording. - Apply the same rule to per-turn cost chips that use
turnCost.
Implementation scope
harness/detect.rs + snapshot type, apps/desktop/src/acp/rustcode.ts type, threadTotals.ts, ThreadDetails.tsx, docs (docs/harnesses.md snapshot, docs/data-store.md note).
Out of scope
Changing what is stored in cost_usd, the Statistics page, plan-usage windows.
Acceptance criteria
- The snapshot carries
billingper harness and account; an API-key Claude Code login isapi, a claude.ai loginsubscription, a ChatGPT Codex loginsubscription, unknown outputunknown. - In the mock, a subscription thread shows "API value" with the tip; an API thread still shows "Cost".
- No list-price estimate is labelled "Cost" for a subscription thread.
Testing requirements
Engine unit tests next to the existing json_says_signed_in / probe_answer tests in detect.rs; threadTotals.test.ts cases for each billing kind. CI only.
Dependencies
None. Crosses the ACP boundary: engine and desktop change ship in one PR.
Parallelization
Touches detect.rs; coordinate with the doctor harness-check issue (reads detection, does not change it).
References
#4360, docs/data-store.md (cost rules).
Audit: ade-2026-11
Activity