Repository navigation
Closed as not planned
Closed as not planned
Copy link
Description
Description
Bug Reproduction / Diagnostic Logs
I am hitting this exact 400 inference_failed error when attempting to use deepseek-flash with max reasoning effort on larger code contexts via the Zed editor.
Looking closely at the request payload, the gateway appears to crash/timeout when handling large payload contexts combined with high reasoning modes.
Observed Context & Behavior:
- Payload Size: The request body size is extremely large ("content-length": "2527429", ~2.5 MB), which likely triggers a buffer overflow or proxy-level processing timeout on OpenCode Go.
- Reasoning Parameters: The request was initiated with "reasoningMode": "effort" and "reasoningEffort": "max".
- Gateway Timeout: The upstream attempt failed right around the ~11.5-second mark ("durationMs": 11548).
{
"event": {
"id": "ef9f997c-7299-4737-9c28-65886993fcb2",
"requestID": "ef9f997c-7299-4737-9c28-65886993fcb2",
"workspaceID": "org_01M2ZD6V5KM9RQVTEY1JGXY7GD",
"startedAt": 1790715792274,
"finishedAt": 1790715804530,
"durationMs": 12256,
"outcome": "failed",
"category": "inference",
"protocol": "openai-chat",
"product": "go",
"path": "/inference/go/openai/v1/chat/completions",
"method": "POST",
"stream": true,
"sessionID": "620d6e9c-d11d-4528-920d-48517dc65a7c",
"userAgent": "Zed/1.21.0+stable.362.33c95853ed2b6956f339733c63a8220964ecbeb6 (windows; x86_64)",
"requestedModel": "deepseek-flash",
"model": "deepseek-flash",
"provider": "opencode",
"statusCode": 400,
"errorCode": "inference_failed",
"reasoningMode": "effort",
"reasoningEffort": "max",
"requestHeaders": {
"accept": "*/*",
"content-length": "2527429",
"content-type": "application/json"
},
"attempts": [
{
"provider": "opencode",
"model": "deepseek-flash",
"statusCode": 400,
"durationMs": 11548,
"errorCode": "inference_failed"
}
]
}
}Use code with caution.
Is there an internal context compression or maximum request size constraint missing on the OpenCode gateway for the openai-chat protocol mapping? Any insight or a workaround to clip the buffer size would be appreciated!
Plugins
none
OpenCode version
V2 through Zed IDE Agent Panel
Steps to reproduce
- Open a large project workspace or a single file containing a substantial codebase in the Zed Editor (v1.21.0+).
- Configure your
settings.jsonto route models through OpenCode Go usingdeepseek-flashwith max reasoning effort:"language_models": { "opencode": { "model": "deepseek-flash", "reasoning_mode": "effort", "reasoning_effort": "max" } }
- Open the Chat Panel (
Ctrl+Shift+I) or trigger an Inline Assistant slash command. - Input a prompt that causes Zed to pull extensive workspace context (e.g.,
/fileor/workspace), pushing the outgoing request payload size significantly high (~2.5 MB /content-length: 2527429). - Submit the prompt and observe the connection hang for roughly 11-12 seconds before crashing with a
400 Bad Requestand aninference_failederror code.
Screenshot and/or share link
Operating System
Windows 11
Terminal
Zed IDE Agent Panel
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]bug: OpenCode Go deepseek-flashreturns 400inference_failed on oversized payloads with max reasoning effort[/-][+]bug: OpenCode Go deepseek-flash returns 400inference_failed on oversized payloads with max reasoning effort[/+][-]bug: OpenCode Go deepseek-flash returns 400inference_failed on oversized payloads with max reasoning effort[/-][+]bug: OpenCode Go deepseek-flash returns 400 inference_failed on oversized payloads with max reasoning effort[/+][-]bug: OpenCode Go deepseek-flash returns 400 inference_failed on oversized payloads with max reasoning effort[/-][+]bug: OpenCode Go deepseek-flash returns 400 `inference_failed` on oversized payloads with max reasoning effort[/+]github-actions commentedon Sep 29, 2026
This issue might be a duplicate of existing issues. Please check:
{"model":"deepseek-v4.1-flash"}) after tool-use turns.amin-bake commentedon Sep 29, 2026
The issue can be temporarily resolved by compacting the chart using the
/compactcommand. The bug can be reproduced using theSteps to reproduceguide.neriousy commentedon Oct 21, 2026
Thanks for the report. This is about how the model itself behaves when served through OpenCode Go (repeating itself, broken tool calls, speed, or rejecting large requests), not a bug in the OpenCode app. We pass these reports to our upstream providers. Starting a new session or running
/compactusually helps with loops and oversized-request errors. Closing this to keep the tracker focused; the main discussion is in #50206.