opencode-quota icon indicating copy to clipboard operation
opencode-quota copied to clipboard

[bug]: TUI SideBar does not show

Open anthonyhaussman opened this issue 6 months ago • 7 comments

Pre-flight checks

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I verified this on the current production released OpenCode version, or I explain why not below.

OpenCode version tested

1.14.48

opencode-quota version tested

v3.8.2

Bug summary

Since I upgraded to the latest version of opencode-quota, the sidebar panel no longer shows Quota.

Image

Steps to reproduce

  1. Clean cache directory: rm -rf ~/.cache/opencode
  2. Run opencode
  3. Execute /quota

Expected behavior

The SideBar panel returns quota information

Actual behavior

The SideBar panel does not return quota information

Relevant logs/output

# Quota Status (opencode-quota v3.8.2) (/quota_status) 19:40 12/05/2026
toast:
- configSource: files
- configPaths: /home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json)
- precedence: global defaults -> workspace overrides
- global_config_paths: /home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json)
- workspace_config_paths: (none)
- setting_sources: enableToast<=/home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json) | formatStyle<=/home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json) | percentDisplayMode<=/home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json) | enabledProviders<=/home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json) | showSessionTokens<=/home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json) | tuiSidebarPanel.enabled<=/home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json) | tuiCompactStatus.enabled<=/home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json) | tuiCompactStatus.homeBottom<=/home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json) | tuiCompactStatus.sessionPrompt<=/home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json) | tuiCompactStatus.suppressWhenNativeProviderQuota<=/home/anthony/.config/opencode/opencode-quota/quota-toast.json (opencode-quota/quota-toast.json)
- enabledProviders: copilot,google-gemini-cli
- onlyCurrentModel: false
- currentModel: (error: session.get returned no modelID)
tui:
- workspace_root: /home/anthony
- config_root: /home/anthony
- config_configured: true
- inferred_selected_config_path: /home/anthony/.config/opencode/tui.jsonc
- present_config_paths: /home/anthony/.config/opencode/tui.jsonc
- candidate_config_paths: /home/anthony/.config/opencode/tui.json | /home/anthony/.config/opencode/tui.jsonc | /home/anthony/tui.json | /home/anthony/tui.jsonc | /home/anthony/.opencode/tui.json | /home/anthony/.opencode/tui.jsonc
- quota_plugin_configured: true
- quota_plugin_paths: /home/anthony/.config/opencode/tui.jsonc
- providers:
  - anthropic: disabled unavailable
  - copilot: enabled available
  - openai: disabled unavailable
  - cursor: disabled unavailable
  - qwen-code: disabled unavailable
  - alibaba-coding-plan: disabled unavailable
  - synthetic: disabled unavailable
  - chutes: disabled unavailable
  - crof: disabled unavailable
  - google-antigravity: disabled unavailable
  - google-gemini-cli: enabled available
  - zai: disabled unavailable
  - zhipu: disabled unavailable
  - nanogpt: disabled unavailable
  - minimax-coding-plan: disabled unavailable
  - minimax-china-coding-plan: disabled unavailable
  - kimi-for-coding: disabled unavailable
  - opencode-go: disabled unavailable
paths:
- opencode_dirs: data=/home/anthony/.local/share/opencode config=/home/anthony/.config/opencode cache=/home/anthony/.cache/opencode state=/home/anthony/.local/state/opencode
- auth.json: preferred=/home/anthony/.local/share/opencode/auth.json present=/home/anthony/.local/share/opencode/auth.json candidates=/home/anthony/.local/share/opencode/auth.json
- qwen oauth auth configured: false
- qwen_oauth_source: (none)
- qwen_local_plan: (none)
- alibaba auth configured: false
- alibaba_api_key_source: (none)
- alibaba_api_key_checked_paths: /home/anthony/.config/opencode/opencode.jsonc
- alibaba_api_key_auth_paths: /home/anthony/.local/share/opencode/auth.json
- alibaba coding plan fallback tier: lite
- alibaba_coding_plan: (none)
openai:
- auth_configured: false
- auth_source: (none)
- token_status: (none)
- token_expires_at: (none)
- account_email: (none)
- account_id: (none)
anthropic:
- cli_installed: false
- cli_version: (none)
- auth_status: unknown
- quota_supported: false
- quota_source: (none)
- checked_commands: claude --version
- message: Claude CLI (`claude`) is not installed or not on PATH.
cursor:
- plan: none
- included_api_usd: (none)
- billing_cycle_start_day: (calendar month)
- auth_state: missing
- auth_selected_path: (none)
- auth_present_paths: /home/anthony/.local/share/opencode/auth.json
- auth_candidate_paths: /home/anthony/.local/share/opencode/auth.json | /home/anthony/.config/cursor/cli-config.json | /home/anthony/.config/cursor/auth.json | /home/anthony/.cursor/cli-config.json | /home/anthony/.cursor/auth.json
- plugin_enabled: false
- canonical_plugin_package: @playwo/opencode-cursor-oauth
- provider_configured: false
- config_matches: (none)
- config_checked_paths: /home/anthony/.config/opencode/opencode.json | /home/anthony/.config/opencode/opencode.jsonc | /home/anthony/opencode.json | /home/anthony/opencode.jsonc
- cycle_source: calendar_month
- cycle_reset_at: 2026-05-31T22:00:00.000Z
- api_usage: $0.00 across 0 messages
- auto_composer_usage: $0.00 across 0 messages
- total_cursor_usage: $0.00 across 0 messages
- unknown_cursor_models: 0
- qwen free local quota: path=/home/anthony/.local/state/opencode/opencode-quota/qwen-local-quota.json exists=false
- qwen free local usage: daily=0/1000 rpm=0/60 (default state)
- alibaba coding plan local quota: path=/home/anthony/.local/state/opencode/opencode-quota/alibaba-coding-plan-local-quota.json exists=false
minimax:
- auth_state: none
- api_key_configured: false
- api_key_source: (none)
- api_key_checked_paths: /home/anthony/.config/opencode/opencode.jsonc
- api_key_auth_paths: /home/anthony/.local/share/opencode/auth.json
minimax_china:
- auth_state: none
- api_key_configured: false
- api_key_source: (none)
- api_key_checked_paths: /home/anthony/.config/opencode/opencode.jsonc
- api_key_auth_paths: /home/anthony/.local/share/opencode/auth.json
kimi:
- auth_state: none
- api_key_configured: false
- api_key_source: (none)
- api_key_checked_paths: /home/anthony/.config/opencode/opencode.jsonc
- api_key_auth_paths: /home/anthony/.local/share/opencode/auth.json
opencode_go:
- config_state: none
- config_source: (none)
- config_checked_paths: /home/anthony/.config/opencode/opencode-quota/opencode-go.json
- selected_windows: rolling,weekly,monthly
zai:
- auth_state: none
- api_key_configured: false
- api_key_source: (none)
- api_key_checked_paths: /home/anthony/.config/opencode/opencode.jsonc
- api_key_auth_paths: /home/anthony/.local/share/opencode/auth.json
zhipu:
- auth_state: none
- api_key_configured: false
- api_key_source: (none)
- api_key_checked_paths: /home/anthony/.config/opencode/opencode.jsonc
- api_key_auth_paths: /home/anthony/.local/share/opencode/auth.json
synthetic:
- synthetic api key: configured=false checked=/home/anthony/.config/opencode/opencode.jsonc
chutes:
- chutes api key: configured=false checked=/home/anthony/.config/opencode/opencode.jsonc
crof:
- crof api key: configured=false checked=/home/anthony/.config/opencode/opencode.jsonc
nanogpt:
- api_key_configured: false
- api_key_source: (none)
- api_key_checked_paths: /home/anthony/.config/opencode/opencode.jsonc
- api_key_auth_paths: /home/anthony/.local/share/opencode/auth.json
copilot_quota_auth:
- pat_state: absent
- billing_mode: user_quota
- billing_scope: user
- quota_api: copilot_internal_user
- billing_api_access_likely: true
- remaining_totals_state: available
- pat_checked_paths: /home/anthony/.config/opencode/copilot-quota-token.json
- oauth_configured: true key=github-copilot refresh=true access=true
- effective_source: oauth
- override: none
- live_probe: success
- live_entry_1: [Copilot] (personal) percent_remaining=52 reset_at=2026-06-01T00:00:00.000Z
google_antigravity:
- auth_state: missing
- selected_accounts_path: (none)
- present_accounts_paths: (none)
- candidate_accounts_paths: /home/anthony/.config/opencode/antigravity-accounts.json | /home/anthony/.local/share/opencode/antigravity-accounts.json
- account_count: 0
- valid_account_count: 0
- companion_package_state: missing
- companion_package_path: (none)
- companion_error: Install opencode-antigravity-auth separately to enable Google Antigravity quota
- token_cache_path: /home/anthony/.cache/opencode/opencode-quota/google-access-tokens.json exists=true
- opencode db: preferred=/home/anthony/.local/share/opencode/opencode.db present=/home/anthony/.local/share/opencode/opencode.db candidates=/home/anthony/.local/share/opencode/opencode.db
google_gemini_cli:
- auth_state: present
- auth_source: google
- account_count: 1
- valid_account_count: 1
- companion_package_state: present
- companion_package_path: /home/anthony/.cache/opencode/packages/opencode-gemini-auth@latest/node_modules/opencode-gemini-auth/dist/index.js
- live_probe: success
- live_entry_1: [Gemini CLI] percent_remaining=14 reset_at=2026-05-13T14:59:02Z
storage:
- sessions_in_db: 270
- messages_in_db: 2,353
- assistant_messages_in_db: 1,828
pricing_snapshot:
- pricing: source=https://models.dev/api.json active_source=runtime generated_at=2026-05-12T17:33:36.466Z units=USD per 1M tokens
- selection: configured=auto active=runtime
- runtime_paths: snapshot=/home/anthony/.cache/opencode/opencode-quota/modelsdev-pricing.runtime.min.json refresh_state=/home/anthony/.cache/opencode/opencode-quota/modelsdev-pricing.refresh-state.json
- staleness: age_ms=399,623 max_age_ms=604,800,000 stale=false
- refresh_policy: auto_refresh_days=7
- refresh: last_attempt_at=2026-05-12T17:33:36.466Z last_success_at=2026-05-12T17:33:36.466Z last_failure_at=(none) last_result=success
- providers: anthropic,google,moonshotai,openai,xai,zai
- coverage_seen: priced_keys=9 mapped_but_missing=0 unpriced_keys=0
  - anthropic: models=23 priced_models_seen=3 mapped_but_missing_models_seen=0 unpriced_models_seen=0
  - google: models=36 priced_models_seen=6 mapped_but_missing_models_seen=0 unpriced_models_seen=0
  - moonshotai: models=7 priced_models_seen=0 mapped_but_missing_models_seen=0 unpriced_models_seen=0
  - openai: models=48 priced_models_seen=0 mapped_but_missing_models_seen=0 unpriced_models_seen=0
  - xai: models=26 priced_models_seen=0 mapped_but_missing_models_seen=0 unpriced_models_seen=0
  - zai: models=13 priced_models_seen=0 mapped_but_missing_models_seen=0 unpriced_models_seen=0
supported_providers_pricing:
- anthropic: pricing=yes (models.dev snapshot provider)
- copilot: pricing=yes (connector (priced via models.dev openai))
- openai: pricing=yes (models.dev snapshot provider)
- cursor: pricing=partial (API-pool models map to official pricing; Auto/Composer use bundled static Cursor rates)
- qwen-code: pricing=no (local request-count estimate (free tier, no token pricing API))
- alibaba-coding-plan: pricing=no (local request-count estimate (tiered rolling windows, no token pricing API))
- synthetic: pricing=no (subscription request quota (not token-priced))
- chutes: pricing=no (no local usage observed)
- crof: pricing=no (request quota + credits (not token-priced))
- google-antigravity: pricing=yes (connector (priced via models.dev google/anthropic))
- google-gemini-cli: pricing=yes (connector (priced via models.dev google))
- zai: pricing=yes (models.dev snapshot provider)
- zhipu: pricing=no (no local usage observed)
- nanogpt: pricing=no (subscription request quota + account balance (not token-priced))
- minimax-coding-plan: pricing=no (no local usage observed)
- minimax-china-coding-plan: pricing=no (no local usage observed)
- kimi-for-coding: pricing=no (request quota via Kimi Code API (not token-priced))
- opencode-go: pricing=no (subscription percentage quota via dashboard scraping (not token-priced))
unpriced_models:
- none
unknown_pricing:
- none

If not tested on current production OpenCode, explain why

No response

anthonyhaussman avatar May 12 '26 17:05 anthonyhaussman

Cloning the repository locally, building it (npm install && npm run build), and setting up the configuration to use the local repository seems to work.

Setup tui.jsonc/opencode.jsonc:

...
  "plugin": [
    "/tmp/opencode-quota"
  ],
...
Image

Re-use the default plugin and clean the ~/.cache/opencode trigger the problem.

...
  "plugin": [
    "@slkiser/opencode-quota"
  ],
...

anthonyhaussman avatar May 13 '26 07:05 anthonyhaussman

Same symptom, same versions here (OpenCode 1.14.48, @slkiser/[email protected], macOS arm64). Found the root cause by digging through the OpenCode log:

service=tui.plugin path=@slkiser/[email protected] retry=false loading tui plugin
ERROR service=tui.plugin path=@slkiser/[email protected]
  target=file:///.../@slkiser/[email protected]/node_modules/@slkiser/opencode-quota/dist/tui.tsx
  error: ENOENT: no such file or directory, open
  '.../node_modules/@opentui/core/types.js'

The server-side plugin loads fine (so /quota, /quota_status, toasts still work) but the TUI plugin silently fails to register, which is why the sidebar panel and compact status line don't appear.

Why

dist/tui.tsx is shipped as raw TSX and transpiled by Bun at load time. Bun follows the type-import chain into @opentui/solid → @opentui/core/index.d.ts, which contains:

export * from "./types.js";
// ...and ~16 more siblings

@opentui/[email protected] on npm only ships types.d.ts (and other *.d.ts) — the matching .js runtime stubs are not in the published tarball. Verified directly:

npm pack @opentui/[email protected]
tar -tzf opentui-core-0.2.8.tgz | grep -E "(^package/types|^package/ansi|^package/buffer)"
# → package/types.d.ts        (no types.js)
# → package/ansi.d.ts          (no ansi.js)
# → package/buffer.d.ts        (no buffer.js)
# ...etc

Missing siblings in the published @opentui/[email protected]: ansi.js, audio.js, buffer.js, console.js, edit-buffer.js, editor-view.js, NativeSpanFeed.js, Renderable.js, renderer-theme-mode.js, renderer.js, syntax-style.js, text-buffer-view.js, text-buffer.js, types.js, utils.js, zig-structs.js, zig.js.

This is also consistent with @anthonyhaussman's note that a local npm install && npm run build works — local build resolves a different (intact) @opentui/core state via the workspace, while the npm-installed plugin pulls the broken 0.2.8 tarball.

Local workaround (verified, sidebar + compact status now show)

Stub the missing files so Bun's tsx loader doesn't choke during type resolution. The symbols are actually re-exported from index.js at runtime, so empty stubs are sufficient:

cd ~/.cache/opencode/packages/@slkiser/[email protected]/node_modules/@opentui/core/
for d in *.d.ts; do
  base="${d%.d.ts}"
  [ -e "${base}.js" ] || [ -e "${base}.tsx" ] || [ -d "${base}" ] \
    || printf 'export {};\n' > "${base}.js"
done

Restart OpenCode → sidebar and compact status appear.

Suggested fixes

Either is sufficient:

  1. Pre-compile the TUI plugin entry. Ship dist/tui.js instead of dist/tui.tsx in the "./tui" export. A bundled JS entry won't pull .d.ts files into the runtime resolution graph at all.
  2. Pin to a known-good @opentui/core (or upstream a fix at https://github.com/anomalyco/opentui to publish the missing .js stubs).

Happy to PR option 1 if useful.

Environment

/quota_status
# Quota Status (opencode-quota v3.8.2)
toast:
- configSource: files
- configPaths: /Users/tim/.config/opencode/opencode-quota/quota-toast.json
- enabledProviders: auto
tui:
- workspace_root: /Users/tim/dotfiles
- inferred_selected_config_path: /Users/tim/.config/opencode/tui.json
- quota_plugin_configured: true
- quota_plugin_paths: /Users/tim/.config/opencode/tui.json
- providers:
  - copilot: enabled available
copilot_quota_auth:
- effective_source: oauth
- live_probe: success
- live_entry_1: [Copilot] (personal) percent_remaining=N reset_at=...

(With the workaround applied, /quota_status reports the TUI plugin as configured and live_probe: success; sidebar panel and compact status render correctly.)

tim-hilde avatar May 13 '26 09:05 tim-hilde

Was having this same exact issue up until just now, with the release of OpenCode v1.14.49. Could you try booting OpenCode back up with the regular configs again?

capyBearista avatar May 14 '26 02:05 capyBearista

Hmm, also not sure why Gemini CLI now just shows "quota window" for all three model tier buckets.

capyBearista avatar May 14 '26 02:05 capyBearista

@anthonyhaussman @capyBearista @tim-hilde Thanks for the issue and discussion. Sorry for not being able to address quickly.

The original issue posted by @anthonyhaussman appears to be an OpenCode runtime compatibility issue affecting 1.14.48. It is fixed by newer OpenCode, at least when I tested in a clean cache/path using@slkiser/[email protected] with OpenCode 1.14.50.

Would appreciate if this could be confirmed (since I think me and @capyBearista both use MacOS).

Could someone affected please confirm by:

  1. upgrading OpenCode to latest
  2. clearing ~/.cache/opencode
  3. restarting OpenCode
  4. running /quota_status

I’m currently leaning toward asking users to upgrade OpenCode and clear the package cache rather than adding a package-side post-install shim.

slkiser avatar May 14 '26 20:05 slkiser

For the bug @capyBearista mentioned, should be a separate issue.

slkiser avatar May 14 '26 20:05 slkiser

I have tested it with OpenCode 1.15.0 and it works indeed. 👌 I have a new Gemini cli bug, but unrelated to this issue (I have opened a PR https://github.com/slkiser/opencode-quota/pull/92 for this).

I think this issue can be closed. 🙏

anthonyhaussman avatar May 15 '26 07:05 anthonyhaussman