anomalyco / anomalyco/opencode

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

Open
#39,092 1 comment 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Jul 27, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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:

  • #39071 — Crash on startup after removing a WSL server
  • #39072 — Built-in Synthetic provider: "Authorization header required" + ghost models persist after disabling

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".

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.