Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>OpenCode Models for CopilotNew to Visual Studio Code? Get it now.
OpenCode Models for Copilot

OpenCode Models for Copilot

Mark Fenderov

|
58 installs
| (0) | Free
Automatically sync OpenCode Zen & Go models to GitHub Copilot in VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

OpenCode Copilot Sync Icon

OpenCode Models for Copilot (opencode-copilot-sync)

CI License: MIT GitHub Release

A lightweight (7 KB, zero runtime dependencies) VS Code extension that automatically synchronizes model catalogs from OpenCode Go and OpenCode Zen into GitHub Copilot in VS Code under a single unified provider with smart cost-optimized routing.


✨ Features

  • 🔄 Automatic Background Sync: Activates seamlessly on onStartupFinished when VS Code opens or window reloads.
  • 📊 Usage & Quotas Sidebar: Live view in the Activity Bar showing real-time Go subscription limits (5-hour rolling, weekly, monthly countdowns), model catalog counts, and quick actions.
  • 🛡️ Silent Stall Auto-Recovery: Automatically detects zero-byte stream hangs on upstream proxy connections and recovers with a fresh request ID before erroring.
  • 🎯 Single Unified Provider (OpenCode): All Go, Zen Free, and Zen-exclusive models appear together under a single clean "OpenCode" entry in Copilot's model picker with zero duplicate clutter.
  • 💰 Smart Cost-Optimized Routing:
    • Any model covered by the OpenCode Go flat subscription (e.g. DeepSeek V4, GLM-5.3, Kimi K3, Qwen 3.8, MiniMax M3) routes to /zen/go/v1/chat/completions ($0 per-token).
    • Free-tier models (deepseek-v4-flash-free, mimo-v2.5-free, nemotron-3-ultra-free, big-pickle) and Zen-exclusive models (Claude, GPT, etc.) route to /zen/v1/chat/completions.
    • In cases of overlap, Go flat-rate takes priority—protecting you from paying per-token charges for models already included in your Go plan.
  • 🔑 Zero Key-Entry Friction: Auto-imports your existing credentials from ~/.local/share/opencode/auth.json. If missing, prompts securely and stores the token in VS Code's credential vault.
  • ⚡ Enriched Capabilities: Configures each model with token limits, vision flags, tool calling, and thinking/reasoning effort levels (low, medium, high, xhigh, max).
  • 🛡️ Router Compliance: Injects the required x-opencode-session header on every request to ensure OpenCode's routing and prompt caching function correctly without MissingSessionID errors. Live chat requests get a stable ID reused for the whole conversation (not regenerated per turn), so prompt caching actually kicks in.
  • 🔒 Safe & Non-Destructive: Merges into chatLanguageModels.json while preserving your other custom endpoints (like internal gateways or LiteLLM) and creating rolling timestamped backups.
  • 💻 Cross-Platform: Works on macOS, Linux, Windows, and Windows WSL (configured with extensionKind: ["ui", "workspace"]).

🚀 Quick Install

Option A: Install from GitHub Release (Recommended)

  1. Download opencode-copilot-sync-0.1.2.vsix from the Latest Release.
  2. Install via terminal:
    code --install-extension opencode-copilot-sync-0.1.2.vsix
    
    Or in VS Code: Extensions view (Ctrl+Shift+X / Cmd+Shift+X) → ... menu → Install from VSIX...

Option B: Build from Source

git clone https://github.com/mfenderov/opencode-copilot-sync.git
cd opencode-copilot-sync
npm install
npm run package
code --install-extension opencode-copilot-sync-*.vsix

⚙️ Configuration Settings

Customize behavior via VS Code Settings (Cmd+, / Ctrl+, search for opencode):

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) OpenCode in 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: Open chatLanguageModels.json in 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 Key once 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

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft