OpenCode¶
Uses your configured OpenCode provider and model for inference.
Setup¶
- Install OpenCode and ensure it's running (
opencodein a terminal) - Ensure
sqlite3is installed and available onPATHif you want Sidekick to monitor OpenCode sessions - Sidekick connects to the local server on port 4096
- Set
sidekick.inferenceProvidertoopencodein settings
How It Works¶
- Uses
@opencode-ai/sdkto connect to the local OpenCode server - Model selection is handled by your OpenCode configuration
- Tier values (fast/balanced/powerful) are passed as hints, but OpenCode's settings take precedence
Session Monitoring¶
OpenCode sessions are monitored from OpenCode's platform-specific data directory:
- Linux:
~/.local/share/opencode/ - macOS:
~/Library/Application Support/opencode/ - Windows:
%APPDATA%\\opencode\\
Set sidekick.sessionProvider to opencode or leave as auto.
Sidekick reads opencode.db for DB-backed session discovery and monitoring. If opencode.db exists but sqlite3 is missing or cannot be executed in the current environment, Sidekick now shows an actionable OpenCode-specific notice instead of silently failing session detection.
z.ai Coding Plan quota¶
When OpenCode is configured with a z.ai Coding Plan (GLM), Sidekick reads the same quota endpoint used by z.ai's first-party usage plugin and displays the account's current 5-hour and weekly token quota.
- CLI:
sidekick quota --provider zairenders authoritative 5-Hour / Weekly utilization from z.ai, including projected end-of-window utilization;sidekick quota --provider opencodeauto-routes to z.ai when z.ai traffic is detected;sidekick quota --allincludes the z.ai section when available;sidekick quota history --provider zairenders the 13-week heatmap. - VS Code: the dashboard shows a z.ai quota card labeled "Live z.ai API" or "Cached z.ai API snapshot".
How it works: Sidekick calls GET https://api.z.ai/api/monitor/usage/quota/limit with the z.ai token already stored by OpenCode (auth.json, preferring zai-coding-plan over zai). If those credentials are not available, Sidekick falls back to the official plugin environment variables: ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.
Limitations¶
- No z.ai inference provider. z.ai is monitored through OpenCode credentials. You cannot select z.ai directly as an inference provider (
sidekick.inferenceProviderremainsclaude-max | claude-api | opencode | codex). - No z.ai account management. z.ai accounts cannot be saved, listed, or switched like Claude and Codex accounts in this release.
- Cached fallback only. If the z.ai API is unavailable, Sidekick may show the latest cached z.ai quota snapshot. It no longer estimates account quota from local traffic.
- No native (non-z.ai) OpenCode quota. OpenCode itself reports no rate-limit data; quota only appears when traffic is z.ai-routed.
- Session asset extraction (
sidekick extract, Sidekick: Extract Session Assets) does not support OpenCode yet — only Claude Code and Codex.
Troubleshooting¶
Connection issues¶
- Ensure OpenCode is running (
opencodein a terminal) - Sidekick connects to
http://127.0.0.1:4096by default
Session monitoring issues¶
- Ensure
sqlite3is installed and available onPATH - If VS Code or your shell uses a different runtime environment, verify
sqlite3is available there too - If Sidekick reports an OpenCode runtime notice, confirm
sqlite3can readopencode.dbdirectly and then retry