Skip to content

[BUG] opencode-go qwen3.7-max intermittently returns 500 Internal server error on text requests #30310

Closed as not planned

Description

@Aerytgophilis

Description

opencode-go/qwen3.7-max intermittently returns HTTP 500 Internal server error via https://opencode.ai/zen/go/v1/messages, even for normal text-only requests.

This is not the oa-compat 401 issue; this is a direct /v1/messages 500 from the OpenCode Go endpoint.

OpenCode version

1.15.11

Environment

  • OS: Windows 11
  • Network: mainland China, proxy/TUN in use (Mihomo)
  • Provider: opencode-go
  • Model: qwen3.7-max

Steps to reproduce

  1. Start OpenCode with model opencode-go/qwen3.7-max
  2. Send a normal text prompt (no image attachments)
  3. Observe repeated failures from https://opencode.ai/zen/go/v1/messages

Actual behavior

Intermittent repeated failures with:

  • statusCode: 500
  • responseBody: {"type":"error","error":{"type":"error","message":"Internal server error"}}

From local OpenCode logs (~/.local/share/opencode/log/2026-06-02T015530.log), multiple consecutive failures occurred around 2026-06-02T01:56:45Z to 01:57:15Z, all for providerID=opencode-go modelID=qwen3.7-max, all targeting:

  • https://opencode.ai/zen/go/v1/messages

Sample Cloudflare Ray IDs captured in the same failures:

  • a052d7c16bd3703b-SEA
  • a052d7ed2b37703b-SEA
  • a052d826f8cc2eb8-SEA
  • a052d87c2ca0759e-SEA

Expected behavior

For text-only requests, qwen3.7-max should respond normally (or return a structured model/provider error), not generic 500.

Cross-reference

Possible related reports for cross-validation:

If needed, I can provide a sanitized snippet of the full failing request metadata from local logs.

Activity

  1. SodiqovSardor commented on Jun 2, 2026

    @SodiqovSardor

    yea yea im getting the same error on me its literally saying

  2. SodiqovSardor commented on Jun 2, 2026

    @SodiqovSardor
  3. dwizzle204 commented on Jul 8, 2026

    @dwizzle204

    Possible root cause found: session_id header triggers 500

    Identified a specific trigger for these 500s on the opencode-go API. The session_id HTTP header — sent when a client enables session affinity — causes the opencode-go backend to return HTTP 500.

    Tested against https://opencode.ai/zen/go/v1/chat/completions:

    • Requests without the session_id header → 200 (even with thinking + stream + cache retention params)
    • Requests with the session_id header → 500 (even with a minimal body of just model, messages, max_tokens)

    The x-client-request-id and x-session-affinity headers alone do not trigger the error — only session_id does.

    This would explain the "intermittent" pattern: clients that send session affinity headers via compat flags (like sendSessionAffinityHeaders: true) hit the 500, while those that do not succeed normally. The fix would be on the opencode-go API side to ignore or gracefully handle the session_id header rather than returning a server error.

  4. Morteza363831 commented on Sep 6, 2026

    @Morteza363831

    I have got similar exception when using qwen 3.8 flash .
    details :

    timestamp=2026-09-06T13:26:39.681Z level=ERROR run=2bfa5e18 message="stream error" providerID=opencode-go modelID=qwen3.8-flash session.id=ses_f8925fa43ffeJENmizm5sil7vf small=false agent=build mode=primary error.error="AI_APICallError: Internal server error"
    timestamp=2026-09-06T13:26:39.681Z level=ERROR run=2bfa5e18 message=process session.id=ses_f8925fa43ffeJENmizm5sil7vf messageID=msg_076e43f59001a094F7ePLQOMGL error="Internal server error" stack="AI_APICallError: Internal server error\n    at <anonymous> (/$bunfs/root/chunk-hh3xjpxg.js:6:14527)\n    at async <anonymous> (/$bunfs/root/chunk-hh3xjpxg.js:6:12658)\n    at processTicksAndRejections (native:7:39)"
    

    How can i fix it ?

  5. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions