Skip to content

Token counter broken in Desktop App with Synthetic provider (cost stuck at $0, usage at 0%, tokens frozen) #39092

Closed as not planned

Description

@drfrangipane

Version

OpenCode Desktop v1.18.4, Windows 10, active Synthetic API key (syn_...)

Context

Using the OpenCode Desktop App with the Synthetic provider (both the built-in provider and a custom OpenAI-compatible provider).

This bug is related to two issues reported earlier today:

All three issues share the same context: a state reset performed to recover from the WSL crash (#39071). The token counter bug appeared alongside the provider regression in #39072.

Problem

The token counter at the bottom of the session shows inconsistent values:

  • Cost : stays at $0 regardless of conversation length
  • Usage : stays at 0%
  • Tokens : displays 28690 (value does not appear to evolve as expected, need to verify whether tokens decrease over the session)

Steps to reproduce

  1. Launch the OpenCode Desktop App
  2. Start a session with the Synthetic provider (built-in or custom)
  3. Exchange several messages
  4. Observe the counter at the bottom: cost at $0, usage at 0%, tokens frozen

Environment

  • OpenCode Desktop v1.18.4
  • Windows 10
  • Provider: Synthetic (built-in) and Synthetic Custom (OpenAI-compatible, baseURL https://api.synthetic.new/openai/v1)
  • The bug reproduces with both provider configurations

Hypotheses

  • The Synthetic / custom provider may not return token usage metadata in its response, or OpenCode does not parse it correctly for this type of provider.
  • The $0 cost may stem from a missing price/token entry in the models.dev catalog for Synthetic models.

Suggestions

  1. Verify that token usage metadata parsing works for custom OpenAI-compatible providers.
  2. Allow users to manually set the price/token for custom providers so cost can be computed.
  3. When usage data is unavailable, display n/a instead of 0 to distinguish "no data" from "zero consumption".

Activity

  1. drfrangipane commented on Jul 27, 2026

    @drfrangipane
    Author

    Update: after a longer observation, the token counter does increase correctly over the conversation. It is not frozen. What remains broken: the cost ($) stays at $0 and the usage percentage stays at 0%. Only the token count works among the three values.

  2. github-actions commented on Sep 26, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

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