Skip to content

tui: footer cost marker missing for providers that do not report cost (2.2.0) #59923

Closed as duplicate

Description

@alvarosego01

Summary

Since OpenCode 2.2.0 the TUI footer no longer shows the session cost ($X.XX) for providers that do not report cost. 2.2.0 switched session cost to provider-reported values (#58562); with subscription-style providers (e.g. OpenCode Go models) the reported cost is always 0, and the footer hides the cost segment when it is not greater than 0. So the marker is gone entirely, even though everything needed to estimate it client-side is still available.

Environment

  • opencode version: 2.2.0
  • OS: Linux 7.0.0-38-generic (x64)
  • Terminal: WarpTerminal (xterm-256color, truecolor)
  • Shell: /bin/bash
  • Install/channel: latest (stable)
  • Active plugins: @miguelmartens/opencode-caveman (server), plus local TUI plugins (go-account-label, session-cost-estimate)

Reproduction

  1. Use a subscription-based provider whose models do not report per-token cost (OpenCode Go models in my case).
  2. Run a session and generate a few responses.
  3. Watch the footer: context usage (180.7K (18%)) renders, but no $ cost marker ever appears.
  4. GET /api/session shows "cost": 0 for every session despite non-zero token usage.

Expected Behavior

The footer should keep showing session cost, falling back to a local estimate (session tokens × model catalog pricing) when the provider does not report one — the same calculation OpenCode performed locally before 2.2.0. Or, at minimum, the fallback should be configurable.

Actual Behavior

No cost marker in the footer at all. The session cost stored/returned by the server is 0 for every session on 2.2.0.

Additional Context

  • The regression started exactly at v2.2.0. Local history (same provider, same machines): every session up to v2.1.4 recorded non-zero cost; all 20 sessions created after updating to 2.2.0 recorded exactly 0.0, including long ones with millions of cache-read tokens.
  • The data needed for the old estimate is still exposed to the TUI: data.session.get(id).tokens (cumulative input/output/cache read/write) and the model catalog prices. I shipped a small TUI plugin that recomputes tokens × catalog pricing in the prompt.footer.status slot and the numbers match the pre-2.2.0 behavior closely, so the information is available client-side.
  • Happy to provide more diagnostics if useful.

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the clear report and for checking the before/after data.

    I think this is a duplicate of #59861. That issue asks for the same thing: an optional estimate from catalog prices in the TUI footer and sidebar when a provider reports a $0 cost, as OpenCode Go does for usage covered by the subscription.

    Some context: the $0 is intended in 2.2.0. Since #58562, OpenCode records the cost the endpoint reports, and a reported zero counts as the real cost. Catalog pricing is only used when an endpoint doesn't report a cost. The non-zero figures before 2.2.0 were estimates at list prices, not amounts you were charged. You can see how much of your Go allowance you've used with /usage.

    Possible duplicates and related issues, ordered by likelihood:

    Your local plugin is a good stopgap until then. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    Closing this as a duplicate of #59861. It asks for the same thing: an optional estimate from catalog prices in the footer and sidebar when the provider reports a $0 cost. Please follow #59861 and the open PR #59864, which adds it as an opt-in experimental.cost-estimate. I left this open for a day in case it was different, and there was no reply. If it is different, comment here and we can reopen it. Thanks again for the detailed report and the plugin workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions