Skip to content

fix(desktop): label subscription thread cost as API value, not a bill #4377

Backlog

Description

@LHagfoss

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-2 and personal-1 hold $300.75 and $172.05 of cost_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", although docs/data-store.md states 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.ts turnCost / threadTotals: reported cost, else estimateUsd.
  • apps/desktop/src/ui/ThreadDetails.tsx:239-249: label "Cost" and its tip.
  • apps/desktop/src/ui/StatisticsPage.tsx:514 and :955: the existing subscription caveat.
  • Sign-in kind is already known to the engine: rustcode/engine/src/harness/detect.rs parses claude auth status --json (authMethod: claude.ai vs api_key) and codex login status ("Logged in using ChatGPT"); provider_auth/claude_usage.rs:564 reads subscriptionType.

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

  1. Engine: add billing: "subscription" | "api" | "unknown" to each harness and account in _rustcode/harnesses (from the status probes it already runs; built-in profiles are api unless plan-backed).
  2. 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"; unknown keeps today's wording.
  3. 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 billing per harness and account; an API-key Claude Code login is api, a claude.ai login subscription, a ChatGPT Codex login subscription, unknown output unknown.
  • 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

  1. added
    bug
    ui
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions