You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenCode is unable to invoke third-party models added by enterprises in GitHub Copilot. #34030
This issue might be a duplicate of existing issues. Please check:
[FEATURE]: dynamic model list for copilot plugin #13470: Feature request for dynamic model list for copilot plugin, which discusses the same root problem — enterprise admins can enable/disable models but OpenCode uses a static list from models.dev and doesn't query per-user available models.
If your issue is specifically about the static model list not reflecting enterprise-managed models, #13470 is likely the most relevant existing report.
This issue might be a duplicate of existing issues. Please check:
[FEATURE]: dynamic model list for copilot plugin #13470: Feature request for dynamic model list for copilot plugin, which discusses the same root problem — enterprise admins can enable/disable models but OpenCode uses a static list from models.dev and doesn't query per-user available models.
If your issue is specifically about the static model list not reflecting enterprise-managed models, #13470 is likely the most relevant existing report.
There is a difference. What I'm focusing on is using third-party models configured in GitHub Copilot's enterprise settings. The current issue is that OpenCode cannot read them.
OpenCode 1.17.11 does not automatically discover some GitHub Copilot Business / enterprise Experimental models that are visible to the same authenticated account when the request uses VS Code / Copilot CLI style headers.
The missing models are returned by the Copilot /models API only when these headers are included:
With OpenCode's default model discovery headers, the models are absent. Manually registering the models in opencode.json and adding the same headers at the model level makes OpenCode able to use them.
Environment
OpenCode version: 1.17.11
OS: Linux
GitHub Copilot auth in OpenCode: oauth configured for provider github-copilot
Copilot plan/SKU: Copilot Business seat, login redacted
Use this shape in ~/.config/opencode/opencode.json under the top-level provider object. Merge it with existing providers instead of replacing the entire file.
opencode run -m "github-copilot/*/GLM/glm-5.2" --format json "Reply exactly OK"
Expected minimal response:
OK
Suggested Upstream Fix Areas
GitHub Copilot model discovery should use the same headers official Copilot clients use, or otherwise preserve account-specific enterprise / Experimental model visibility.
provider.github-copilot.options.headers appears in resolved config, but in this test it did not make opencode models github-copilot discover the Experimental models. If provider-level headers are intended to affect Copilot model discovery, this may be a bug.
If a slash-containing model ID is not registered, opencode run -m provider/model/with/slashes currently degrades into model=undefined and an Unexpected server error. A clearer model not found error would make diagnosis easier.
When Copilot /models returns picker-enabled IDs containing slashes, OpenCode should be able to register and select those IDs without requiring manual opencode.json entries.
GitHub Copilot model discovery should use the same headers official Copilot clients use, or otherwise preserve account-specific enterprise / Experimental model visibility.
Nah we arent supposed to. They gave us specific guidelines and we follow them.
What I'm trying to say is that my account has the necessary permissions, and I can see the corresponding model on GitHub Copilot and use it there, but by default, it isn't detected on OpenCode.
i dont have access to 3rd party models in an enterprise setup, so need some community support to help figure it out, look into the github copilot model fetching logic, see whats wrong w/ it if anything
Activity
github-actions commentedon Jun 26, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is specifically about the static model list not reflecting enterprise-managed models, #13470 is likely the most relevant existing report.
KTY810 commentedon Jun 26, 2026
There is a difference. What I'm focusing on is using third-party models configured in GitHub Copilot's enterprise settings. The current issue is that OpenCode cannot read them.
KTY810 commentedon Jun 26, 2026
OpenCode GitHub Copilot Experimental Models Debug Report
Issue Summary
OpenCode 1.17.11 does not automatically discover some GitHub Copilot Business / enterprise Experimental models that are visible to the same authenticated account when the request uses VS Code / Copilot CLI style headers.
The missing models are returned by the Copilot
/modelsAPI only when these headers are included:With OpenCode's default model discovery headers, the models are absent. Manually registering the models in
opencode.jsonand adding the same headers at the model level makes OpenCode able to use them.Environment
1.17.11oauthconfigured for providergithub-copilot~/.config/opencode/opencode.jsonReproduction Data
The same OpenCode GitHub Copilot OAuth token was used for both requests below. Only headers changed. Authorization values are redacted and not shown.
Request A: OpenCode-style default headers
Request target:
Headers used, excluding authorization:
{ "User-Agent": "opencode/1.17.11", "X-GitHub-Api-Version": "2026-06-01", "Accept": "application/json" }Sanitized response summary:
{ "status": 200, "totalReturned": 33, "pickerEnabled": 16, "experimental": [], "allPickerIds": [ "claude-haiku-4.5", "claude-opus-4.5", "claude-opus-4.6", "claude-opus-4.7", "claude-opus-4.8", "claude-sonnet-4.5", "claude-sonnet-4.6", "gemini-2.5-pro", "gemini-3-flash-preview", "gemini-3.1-pro-preview", "gemini-3.5-flash", "gpt-5-mini", "gpt-5.3-codex", "gpt-5.4", "gpt-5.4-mini", "gpt-5.5" ] }Request B: VS Code / Copilot CLI-style headers
Request target:
Headers used, excluding authorization:
{ "User-Agent": "GithubCopilot/1.155.0", "Editor-Version": "vscode/1.107.1", "Editor-Plugin-Version": "copilot-chat/0.26.7", "Copilot-Integration-Id": "copilot-developer-cli", "X-GitHub-Api-Version": "2026-06-01", "Accept": "application/json" }Sanitized response summary:
{ "status": 200, "totalReturned": 39, "pickerEnabled": 21, "experimental": [ "*/GLM/glm-5.1", "*/GLM/glm-5.2", "*/HUAWEI/glm-5.2", "*/QDeepseekV4/deepseek-v4-flash", "*/QDeepseekV4/deepseek-v4-pro", "*/Qwen37plus/qwen3.7-plus" ] }Experimental Model API Metadata
The Experimental models returned by Request B are picker-enabled and support
/chat/completions.[ { "id": "*/QDeepseekV4/deepseek-v4-flash", "name": "deepseek-v4-flash", "model_picker_enabled": true, "supported_endpoints": ["/chat/completions"], "limits": { "max_context_window_tokens": 1000000, "max_prompt_tokens": 840000, "max_output_tokens": 128000 }, "supports": { "streaming": true, "tool_calls": true } }, { "id": "*/QDeepseekV4/deepseek-v4-pro", "name": "deepseek-v4-pro", "model_picker_enabled": true, "supported_endpoints": ["/chat/completions"], "limits": { "max_context_window_tokens": 1000000, "max_prompt_tokens": 840000, "max_output_tokens": 128000 }, "supports": { "tool_calls": true } }, { "id": "*/Qwen37plus/qwen3.7-plus", "name": "qwen3.7-plus", "model_picker_enabled": true, "supported_endpoints": ["/chat/completions"], "limits": { "max_context_window_tokens": 1000000, "max_prompt_tokens": 991000, "max_output_tokens": 64000 }, "supports": { "tool_calls": true } }, { "id": "*/GLM/glm-5.1", "name": "glm-5.1", "model_picker_enabled": true, "supported_endpoints": ["/chat/completions"], "limits": { "max_context_window_tokens": 200000, "max_prompt_tokens": 167232, "max_output_tokens": 32768 }, "supports": { "tool_calls": true } }, { "id": "*/GLM/glm-5.2", "name": "glm-5.2", "model_picker_enabled": true, "supported_endpoints": ["/chat/completions"], "limits": { "max_context_window_tokens": 1000000, "max_prompt_tokens": 868928, "max_output_tokens": 131072 }, "supports": { "tool_calls": true } }, { "id": "*/HUAWEI/glm-5.2", "name": "huawei-glm5.2", "model_picker_enabled": true, "supported_endpoints": ["/chat/completions"], "limits": { "max_context_window_tokens": 192000, "max_prompt_tokens": 128000, "max_output_tokens": 64000 }, "supports": { "tool_calls": true } } ]OpenCode Behavior Before Workaround
opencode models github-copilotBefore manual configuration, OpenCode listed only the standard GitHub Copilot models and did not list any
*/...Experimental model.Direct use of a raw Experimental ID without registration
Command:
Observed result:
{ "type": "error", "error": { "name": "UnknownError", "data": { "message": "Unexpected server error. Check server logs for details." } } }Relevant sanitized log:
This indicates that an unknown slash-containing model ID is not cleanly resolved when it is not already registered in OpenCode's model catalog.
Manual raw ID registration without model-level headers
After registering the raw model ID in a temporary local
opencode.json, OpenCode did send the full model ID:But the API returned:
{ "error": { "message": "The requested model is not supported.", "code": "model_not_supported", "param": "model", "type": "invalid_request_error" }, "metadata": { "url": "https://api.githubcopilot.com/chat/completions" } }This was fixed by adding the VS Code / Copilot CLI-style headers at the model level.
Confirmed Workaround
Register the Experimental models manually under the
github-copilotprovider and attach the VS Code / Copilot CLI-style headers to each model.After this workaround, OpenCode lists the models:
And this command succeeds:
Sanitized successful response:
{ "type": "text", "text": "OK" }Relevant sanitized success log:
Current Local OpenCode Configuration Applied
File changed:
The current configuration adds these models under
provider.github-copilot.models.Each model has:
{ "family": "custom", "tool_call": true, "temperature": false, "experimental": true, "headers": { "Editor-Version": "vscode/1.107.1", "Editor-Plugin-Version": "copilot-chat/0.26.7", "Copilot-Integration-Id": "copilot-developer-cli" } }The six configured model IDs are:
Copy-Paste Configuration Snippet
Use this shape in
~/.config/opencode/opencode.jsonunder the top-levelproviderobject. Merge it with existing providers instead of replacing the entire file.{ "provider": { "github-copilot": { "models": { "*/QDeepseekV4/deepseek-v4-flash": { "name": "deepseek-v4-flash", "family": "custom", "limit": { "context": 1000000, "input": 840000, "output": 128000 }, "tool_call": true, "temperature": false, "experimental": true, "headers": { "Editor-Version": "vscode/1.107.1", "Editor-Plugin-Version": "copilot-chat/0.26.7", "Copilot-Integration-Id": "copilot-developer-cli" } }, "*/QDeepseekV4/deepseek-v4-pro": { "name": "deepseek-v4-pro", "family": "custom", "limit": { "context": 1000000, "input": 840000, "output": 128000 }, "tool_call": true, "temperature": false, "experimental": true, "headers": { "Editor-Version": "vscode/1.107.1", "Editor-Plugin-Version": "copilot-chat/0.26.7", "Copilot-Integration-Id": "copilot-developer-cli" } }, "*/Qwen37plus/qwen3.7-plus": { "name": "qwen3.7-plus", "family": "custom", "limit": { "context": 1000000, "input": 991000, "output": 64000 }, "tool_call": true, "temperature": false, "experimental": true, "headers": { "Editor-Version": "vscode/1.107.1", "Editor-Plugin-Version": "copilot-chat/0.26.7", "Copilot-Integration-Id": "copilot-developer-cli" } }, "*/GLM/glm-5.1": { "name": "glm-5.1", "family": "custom", "limit": { "context": 200000, "input": 167232, "output": 32768 }, "tool_call": true, "temperature": false, "experimental": true, "headers": { "Editor-Version": "vscode/1.107.1", "Editor-Plugin-Version": "copilot-chat/0.26.7", "Copilot-Integration-Id": "copilot-developer-cli" } }, "*/GLM/glm-5.2": { "name": "glm-5.2", "family": "custom", "limit": { "context": 1000000, "input": 868928, "output": 131072 }, "tool_call": true, "temperature": false, "experimental": true, "headers": { "Editor-Version": "vscode/1.107.1", "Editor-Plugin-Version": "copilot-chat/0.26.7", "Copilot-Integration-Id": "copilot-developer-cli" } }, "*/HUAWEI/glm-5.2": { "name": "huawei-glm5.2", "family": "custom", "limit": { "context": 192000, "input": 128000, "output": 64000 }, "tool_call": true, "temperature": false, "experimental": true, "headers": { "Editor-Version": "vscode/1.107.1", "Editor-Plugin-Version": "copilot-chat/0.26.7", "Copilot-Integration-Id": "copilot-developer-cli" } } } } } } ## Commands Used for Verification List GitHub Copilot models visible to OpenCode: ```bash opencode models github-copilotRun one Experimental model:
Expected minimal response:
Suggested Upstream Fix Areas
provider.github-copilot.options.headersappears in resolved config, but in this test it did not makeopencode models github-copilotdiscover the Experimental models. If provider-level headers are intended to affect Copilot model discovery, this may be a bug.opencode run -m provider/model/with/slashescurrently degrades intomodel=undefinedand anUnexpected server error. A clearermodel not founderror would make diagnosis easier./modelsreturns picker-enabled IDs containing slashes, OpenCode should be able to register and select those IDs without requiring manualopencode.jsonentries.rekram1-node commentedon Jun 27, 2026
Nah we arent supposed to. They gave us specific guidelines and we follow them.
KTY810 commentedon Jun 29, 2026
What I'm trying to say is that my account has the necessary permissions, and I can see the corresponding model on GitHub Copilot and use it there, but by default, it isn't detected on OpenCode.
KTY810 commentedon Jul 1, 2026
This is likely an issue with GitHub Copilot rather than OpenCode.
brunogabriel commentedon Jul 7, 2026
Any update?
rekram1-node commentedon Jul 7, 2026
i dont have access to 3rd party models in an enterprise setup, so need some community support to help figure it out, look into the github copilot model fetching logic, see whats wrong w/ it if anything
github-actions commentedon Sep 6, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.