anomalyco / anomalyco/opencode

bug: GitHub Copilot fails with 'Upstream request failed (400)' on Windows/macOS when querying repository context with custom models

Open
#38,982 1 comment 2 reactions 1 assignee View on GitHub

@MrMushrooooom is already working on this.

Since Jul 26, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description
Description

I am using GitHub Copilot via VS Code custom endpoint configuration to access OpenCode models. The setup works perfectly for simple independent messages (like "Hi"), but completely crashes with a 400 Bad Request error on both Windows and macOS platforms whenever I ask GitHub Copilot about my repository context, select code blocks, or query active workspace files.

The upstream proxy server rejects the request when GitHub Copilot bundles the repository context metadata and system tools into the payload.

My Full Configuration File

Here is the exact JSON configuration I am using inside GitHub Copilot. All listed models work flawlessly with project-context queries except for the DeepSeek models, which trigger the 400 error:

[
 {
 "name": "OpenCode",
 "vendor": "customendpoint",
 "apiKey": "${input:chat.lm.secret.70331fbe}",
 "apiType": "chat-completions",
 "models": [
 {
 "id": "big-pickle",
 "name": "Free: Big Pickle",
 "url": "https://opencode.ai/zen/v1/chat/completions",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "nemotron-3-ultra-free",
 "name": "Free: Nemotron 3 Ultra Free",
 "url": "https://opencode.ai/zen/v1/chat/completions",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "deepseek-v4-flash",
 "name": "DeepSeek V4 Flash",
 "url": "https://opencode.ai/zen/go/v1/chat/completions",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "deepseek-v4-pro",
 "name": "DeepSeek V4 Pro",
 "url": "https://opencode.ai/zen/go/v1/chat/completions",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "kimi-k2.7-code",
 "name": "Kimi K2.7 Code",
 "url": "https://opencode.ai/zen/go/v1/chat/completions",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "kimi-k2.6",
 "name": "Kimi K2.6",
 "url": "https://opencode.ai/zen/go/v1/chat/completions",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "glm-5.2",
 "name": "GLM 5.2",
 "url": "https://opencode.ai/zen/go/v1/chat/completions",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "glm-5.1",
 "name": "GLM 5.1",
 "url": "https://opencode.ai/zen/go/v1/chat/completions",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "mimo-v2.5-pro",
 "name": "MiMo V2.5 Pro",
 "url": "https://opencode.ai/zen/go/v1/chat/completions",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "mimo-v2.5",
 "name": "MiMo V2.5",
 "url": "https://opencode.ai/zen/go/v1/chat/completions",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "qwen3.7-max",
 "name": "Qwen 3.7 Max",
 "url": "https://opencode.ai/zen/go/v1/messages",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "qwen3.7-plus",
 "name": "Qwen 3.7 Plus",
 "url": "https://opencode.ai/zen/go/v1/messages",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "qwen3.6-plus",
 "name": "Qwen 3.6 Plus",
 "url": "https://opencode.ai/zen/go/v1/messages",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "minimax-m3",
 "name": "MiniMax M3",
 "url": "https://opencode.ai/zen/go/v1/messages",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 },
 {
 "id": "minimax-m2.7",
 "name": "MiniMax M2.7",
 "url": "https://opencode.ai/zen/go/v1/messages",
 "toolCalling": true,
 "vision": true,
 "maxInputTokens": 128000,
 "maxOutputTokens": 16000
 }
 ]
 }
]
Steps to Reproduce
  1. Activate the custom OpenCode endpoint profile inside VS Code GitHub Copilot extension.
  2. Select any model (specifically deepseek-v4-flash).
  3. Send a question that queries workspace files or repository structure -> Fails instantly with Error 400.
Error Logs Captured
1. On macOS (Console Go Endpoint):
Reason: Request Failed: 400 {"error":{"message":"Error from provider (Console Go): Upstream request failed","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}: Error: Request Failed: 400 {"error":{"message":"Error from provider (Console Go): Upstream request failed","type":"invalid_request_error","param":null,"code":"invalid_request_error"}} at jG._provideLanguageModelResponse (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/copilot/dist/extension.js:1690:14392)
2. On Windows (Console Endpoint):
Reason: Request Failed: 400 {"error":{"message":"Error from provider (Console): Upstream request failed","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}: Error: Request Failed: 400 {"error":{"message":"Error from provider (Console): Upstream request failed","type":"invalid_request_error","param":null,"code":"invalid_request_error"}} at jG._provideLanguageModelResponse (c:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\1b6a188127\resources\app\extensions\copilot\dist\extension.js:1690:14392) at process.processTicksAndRejections (node:internal/process/task_queues:104:5) at async jG.provideLanguageModelResponse (c:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\1b6a188127\resources\app\extensions\copilot\dist\extension.js:1690:15357)
Environment
  • IDE: Visual Studio Code (Latest stable)
  • Extension: GitHub Copilot (Chat)
  • Platforms: macOS & Windows 10/11
Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.