OpenCode Models for Copilot (
|
| Setting | Default | Description |
|---|---|---|
opencode.autoSyncOnStartup |
true |
Automatically sync models on VS Code launch or window reload. |
opencode.includeGoModels |
true |
Include models from the OpenCode Go subscription catalog. |
opencode.includeZenModels |
true |
Include Zen models (Free tier + Zen exclusive models). |
opencode.streamIdleTimeoutSeconds |
90 |
Watchdog timeout in seconds before auto-recovering or alerting on an idle stream. |
🕹️ Commands, Status Bar & Sidebar
- Activity Bar View: Click the OpenCode hubot icon in the left Activity Bar to see:
- 📊 Real-time Go subscription quotas (rolling 5-hour, weekly, monthly limits & reset timers)
- 🏷️ Active model counts (OpenCode Go flat-rate vs Zen Free tier)
- ⚡ Quick actions to sync models, update API key, and open config
- Status Bar Indicator: Click
$(hubot) OpenCodein the bottom-right status bar to trigger a live sync with spin animation. - Command Palette (
Cmd+Shift+P/Ctrl+Shift+P):OpenCode: Sync Models to Copilot: Manually fetch models and refresh Copilot.OpenCode: Refresh Usage: Refresh Go subscription limits in status bar and sidebar view.OpenCode: Set API Key: Update your OpenCode API key securely.OpenCode: Open Copilot Models Config: OpenchatLanguageModels.jsonin editor.
🪟 Windows & WSL Usage
- VS Code Remote - WSL: Because GitHub Copilot runs on the Windows UI side, the extension is registered to run on the UI host and updates Windows
%APPDATA%\Code\User\chatLanguageModels.json. - If your OpenCode key is stored inside WSL, you can simply run
OpenCode: Set API Keyonce in VS Code to save it to your Windows credential vault.
Remote-SSH, Dev Containers & GitHub Codespaces
The extension's extensionKind: ["ui", "workspace"] setting asks VS Code to activate it on the same host as Copilot Chat in every remote topology, so Remote-SSH, Dev Containers, and Codespaces are expected to work the same way as WSL. These topologies aren't part of the automated test matrix yet (only WSL is), so treat them as best-effort: if sync doesn't pick up your models, run OpenCode: Sync Models to Copilot manually and check the OpenCode output channel (View → Output → OpenCode) for the logged Remote: <name> line, which confirms which host the extension actually activated on.
Known limitation: Agents window under Remote-WSL
OpenCode models show up correctly in Manage Language Models and work fine in the regular Copilot Chat view under Remote-WSL. However, they currently do not appear in the model picker inside the Agents window (the standalone agentic session UI) when the workspace is opened via Remote-WSL.
This is a confirmed upstream VS Code limitation, not a bug in this extension: under Remote-WSL, the Agent Host process communicates over a remote path where the BYOK (Bring-Your-Own-Key) bridge is currently hardcoded as unavailable, regardless of which extension registers the model. It affects every BYOK/custom-endpoint provider under WSL, not just OpenCode. Tracked upstream in microsoft/vscode#332085 — a VS Code team member confirmed "Support for WSL is added to the backlog," with no ETA. Plain Windows and Dev Containers are unaffected.
🛠️ How It Works Under the Hood
VS Code Copilot natively reads custom OpenAI-compatible models from chatLanguageModels.json under the customendpoint vendor. VS Code file-watches this JSON and immediately updates Copilot's model picker whenever the file changes.
This extension connects to OpenCode's catalog APIs (/zen/go/v1/models and /zen/v1/models), transforms them into valid customendpoint specs with the proper x-opencode-session header, and atomically merges them into your User configuration.
In addition, the extension registers a native opencode Language Model Chat Provider directly with VS Code's API (no chatLanguageModels.json involved) wherever it's actually running — this is the primary path, handled entirely by our own request/retry/error-handling code. The customendpoint mirror described above exists only to guarantee visibility on machines/profiles the extension isn't installed on (a separate Windows box, a Remote-WSL server, a Code - Insiders install, etc.). To avoid two near-identical entries for the same models on the one install where the native vendor is already active, the extension does not write (and actively purges) the customendpoint OpenCode entry from that install's own local chatLanguageModels.json — it keeps writing it everywhere else.
📄 License
MIT © Mark Fenderov