Skip to content

tui: optional catalog-price estimate for providers that report $0 session cost #59861

Open

Description

@simonsilie

Summary

Since v2.2.0, provider-reported session costs override the catalog-price
estimate, and a reported zero is authoritative. OpenCode Go reports $0
(subscription-included usage), so the "$X spent" line no longer appears in the
sidebar Context section or the prompt footer for Go sessions. I'd like an
optional catalog-price-based estimate for providers that report $0.

Environment

  • opencode version: 2.2.0
  • OS: macOS 26.2 (Darwin 27.0.0, arm64)
  • Terminal: Apple_Terminal, xterm-256color, truecolor
  • Shell: /bin/zsh
  • Install/channel: Homebrew, latest release
  • Active plugins: ./herdr-opencode (local, via ~/.config/opencode/cli.json)

Reproduction

  1. Update to opencode v2.2.0.
  2. Run a session on an OpenCode Go model (e.g. opencode-go/glm-5.3-flash) and
    exchange a few messages.
  3. Check the sidebar Context section and prompt footer.

Expected Behavior

Show a catalog-price-based "$X spent" estimate (clearly marked as an estimate)
for providers that report $0 due to subscription billing, keeping parity with
pay-per-token providers.

Actual Behavior

Recorded cost stays 0, and both the sidebar Context section and prompt footer
hide the money figure entirely (they only render when cost > 0). Only token
counts and "% used" remain.

Additional Context

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the clear write-up and the before/after data!

    You'd like an optional, clearly-labelled "$X spent" estimate based on catalog prices, shown in the TUI sidebar and prompt footer when a provider reports a $0 charge, as it does for OpenCode Go subscription usage.

    For context: the $0 is intentional in 2.2.0. Since #58562, OpenCode records the cost the endpoint reports and treats a reported zero as authoritative. Catalog pricing is now only a fallback for endpoints that don't report a cost. So this is a new option rather than a regression. Maintainers will consider it.

    Related issues:

    In the meantime, a TUI plugin could probably show a figure like this through the sidebar.content or prompt.footer.status slots, by pricing the session's tokens from the model catalog.

  2. Mittelwelt commented on Oct 28, 2026

    @Mittelwelt

    Yes. Frankly who literally freaking thought that hiding an estimate instead of clearly flagging as an "estimate" would be a better choice here?

    Bring this back please. Thank you.

  3. henryrt commented on Oct 28, 2026

    @henryrt

    Please bring back the continuous cost display. I record the costs for each unit of work done by a model and now I have to jump through hoops to get it. I know it's not what I actually pay since I have Go but I want the data.

  4. augustovicente commented on Oct 30, 2026

    @augustovicente

    up

  5. dcarnicer commented on Nov 5, 2026

    @dcarnicer

    Adding another 2.2.5 data point for the same behavior.

    Environment

    • opencode 2.2.5 (macOS arm64, TUI)
    • provider/model: opencode-go/deepseek-v4.1-flash, variant max

    Before 2.2.0 the prompt footer and sidebar showed the catalog-price estimate. On 2.2.5 all 50 recent Go sessions I checked persist cost: 0 while tokens are recorded normally. The debug usage event from the gateway still contains the list price and the plan allowance:

    {
      "cost": 0,
      "billing_source": "go",
      "list_cost": 0.00236933,
      "allowance": 0.0014216
    }

    So the catalog value is still reported, it is just no longer used for the session cost.

    opencode stats --cost --days 30 still reports $14.01, but that comes from messages created before 2.2.0; new Go messages add 0.

    This is not only cosmetic: after compaction the token count can stay flat while catalog spend keeps accumulating, so losing the cost line removes the easiest signal that a session is running away.

    An opt-in ≈ $X estimate (as proposed here) and/or a per-session allowance figure would restore the visible signal without changing the authoritative $0 cost. This is the same case as #61712. Thanks.

  6. brunojustino commented on Nov 9, 2026

    @brunojustino

    Bring it back please. The estimate really helps you keep track how you spent(this is probably why they hide it). Having the estimate displayed in others providers but not in opencode go makes me want to use other providers instead of opencode go.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions