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
Zen and Go backends fail on DeepSeek V4 / MiMo tool calling with "Internal server error" #36354
Error
When using these models in agent mode, OpenCode shows "Internal server error" and retries repeatedly.
Direct API test shows the backend returns:
{"error":{"message":"Error from provider (Console Go): Upstream request failed","type":"invalid_request_error","code":"invalid_request_error"}}
Verification- Same request without tools parameter → 200 OK- DeepSeek official API with tools → 200 OK- Other Zen/Go models with tools → 200 OKWorking models- Zen: hy3- Go: minimax-m3, glm-5.2, qwen3.6-plus, qwen3.7-maxSuspected root causeOpenCode backend does not correctly handle reasoning_content echoing for DeepSeek V4 tool calls (and possibly MiMo), causing 400 errors that the client displays as "Internal server error".Expected behaviorEither fix backend handling for these models, or update models.json to mark tool_call: false for affected models until fixed.### Pluginsopencode-sessions, opencode-context-cache, magic-context### OpenCode version1.17.18### Steps to reproduce_No response_### Screenshot and/or share link_No response_### Operating SystemWindows 11### Terminalwezterm,Windows
So opencode happily forwards the PDF, and the Zen backend returns 500 on the request — same symptom as #34840 but different failure mode (that one was a client-side "does not support pdf" refusal).
Workarounds that work client-side:
pdftoppm -png the pages, then Read the PNG — images are accepted fine, only the PDF document part triggers the 500
Extract text with PyMuPDF (fitz) via bash
Affects only PDF attachments; plain text/image pastes on the same model work fine.
Activity
github-actions commentedon Jul 11, 2026
This issue might be a duplicate of existing issues. Please check:
reasoning_contentnot passed back for tool call turns, causing 400 errors — same suspected root cause (missingreasoning_contentin tool call history)github-actions commentedon Sep 10, 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.
frangcisneros commentedon Sep 22, 2026
Reproduced the same 500 with mimo-v2.6-flash-free (Zen), specifically when the
Readtool returns a PDF:Steps
opencode/mimo-v2.6-flash-free(OpenCode Zen)Readany PDF (tried a 14-page / 365 KB PDF)AI_APICallError: Internal server error, retries forever (retrying attempt #3...), session unusable until undo/interruptLog (
~/.local/share/opencode/log/opencode.log):(repeats on every retry, both
agent=planandagent=build)Not a metadata issue: models.dev already declares PDF support for this model:
So opencode happily forwards the PDF, and the Zen backend returns 500 on the request — same symptom as #34840 but different failure mode (that one was a client-side "does not support pdf" refusal).
Workarounds that work client-side:
pdftoppm -pngthe pages, thenReadthe PNG — images are accepted fine, only the PDF document part triggers the 500fitz) via bashAffects only PDF attachments; plain text/image pastes on the same model work fine.