anomalyco / anomalyco/opencode
Token counter broken in Desktop App with Synthetic provider (cost stuck at $0, usage at 0%, tokens frozen)
Open
@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
$0regardless 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
- Launch the OpenCode Desktop App
- Start a session with the Synthetic provider (built-in or custom)
- Exchange several messages
- 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
- Verify that token usage metadata parsing works for custom OpenAI-compatible providers.
- Allow users to manually set the price/token for custom providers so cost can be computed.
- When usage data is unavailable, display
n/ainstead of0to distinguish "no data" from "zero consumption".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.