Skip to content

[Bug]: Usage dashboard ignores OpenCode provider sessions, spend shows $0 #11121

Description

@Victor-Casado

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop (Usage dashboard)

Steps to reproduce

  1. Connect an OpenCode provider instance (OpenRouter key, models like openrouter/meta/muse-spark-1.3-contributor).
  2. Run real sessions through T3 Code via that provider.
  3. Open the Usage dashboard.

Expected behavior

Sessions show token usage and cost, same as Claude/Codex sessions.

Actual behavior

Usage shows nothing for OpenCode sessions. Spend reads $0 despite real usage.

Verified locally: the usage scanner only discovers discoverClaudeTranscripts and discoverCodexTranscripts. There is no OpenCode transcript path, and no reference to opencode.db in the bundle. Meanwhile ~/.local/share/opencode/opencode.db holds 6,727 step-finish records totaling ~76.7M input / 1.6M output tokens at ~$9.77 cost. The data exists, nothing reads it.

Related: #10919 (Antigravity usage missing), #5799 (unpriced activity renders as $0.00), #8388 (OpenCode via OpenRouter shows no composer usage meter). Same class: non-Claude/Codex usage invisible.

Impact

Major degradation or frequent failure (all OpenCode spend untracked)

Version or commit

0.0.40

Environment

Linux 6.8.0-124-generic x86_64; OpenCode CLI 1.18.29 via OpenCode provider with OpenRouter key

Logs or stack traces

# opencode.db step-finish totals
steps: 6727, input: 76729866, output: 1618314, cost: $9.7694
# T3 scan cache: 34 files tracked, all provider=claude, 0 opencode

Workaround

Query opencode.db directly:

python3 -c "
import sqlite3, json
db = sqlite3.connect('$HOME/.local/share/opencode/opencode.db')
cost = sum(json.loads(r[0]).get('cost', 0) for r in db.execute(\"select data from part where json_extract(data,'$.type')='step-finish'\"))
print('opencode spend: $%.4f' % cost)
"

Suggested fix

Add an OpenCode usage source: read per-step tokens/cost from opencode.db (part rows, type=step-finish), same as the Claude/Codex transcript parsers. Fall back to LiteLLM rates by model id when a step lacks cost.

Activity

  1. juliusmarminge commented on Sep 10, 2026

    @juliusmarminge
    Member

    Duplicate of #7622 (same gap: Usage page never reads OpenCode's opencode.db, so spend stays $0). That report was closed as a feature ask into discussion #6909.

    Open fix PRs already in flight: #8456 and #10926.

    Related but not the same: #10919 (Antigravity), #5799 (unpriced → $0.00), #8388 (composer context meter).

  2. juliusmarminge commented on Sep 10, 2026

    @juliusmarminge
    Member

    Closing as duplicate of #7622 / tracked in #6909.

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

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions