Skip to content

fix(models): don't pass Claude Code's session header to OpenCode - #845

Merged
leookun merged 1 commit into
mainfrom
fix/opencode-session-header
Nov 8, 2026
Merged

leookun merged 1 commit into
mainfrom
fix/opencode-session-header

Conversation

@leookun

@leookun leookun commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Replaces #844's retry-without-cache_control with a simpler fix: the pass-through no longer forwards X-Claude-Code-Session-Id to opencode.ai. With that header, OpenCode routes deepseek-v4.1-flash to a backend that rejects cache_control; without it the same requests succeed (checked live with a captured Claude Code request).

🤖 Generated with BaoCode

OpenCode sends requests that name the session to a backend whose
validator refuses cache_control, so every new conversation on its
DeepSeek failed with a 400. Not telling it the session is enough;
this replaces the retry-without-marks of #844.

Co-Authored-By: BaoCode <noreply@baocode.dev>
@leookun
leookun merged commit 86e71fd into main Nov 8, 2026
3 checks passed
@leookun
leookun deleted the fix/opencode-session-header branch November 8, 2026 16:29
leookun added a commit that referenced this pull request Nov 9, 2026
…#847)

#845 dropped only X-Claude-Code-Session-Id, but OpenCode still got
x-opencode-session (which the proxy adds itself since #75) and the CLI's
x-session-id; either one alone still routes the request to the backend
that refuses cache_control. Replaying the failing requests from the
usage traces: 400 with any session header, 200 with none.

So nothing that names a session goes to OpenCode, and the proxy adds
x-opencode-session only for Go, which refuses a request without it.
Untold, OpenCode's backend refuses `tools: []` (Claude Code's side
requests), so an empty list is left out.

Co-authored-by: leo <leokuncn@gmail.com>
Co-authored-by: BaoCode <noreply@baocode.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants