Repository navigation
fix(models): tell OpenCode no session at all, nor an empty tools list - #847
Merged
Merged
Conversation
#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: BaoCode <noreply@baocode.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #845, which didn't fix the 400s on OpenCode's DeepSeek.
#845 dropped only
X-Claude-Code-Session-Id. The requests still carriedx-opencode-session(added by the proxy itself since #75) andx-session-id(sent by the CLI). Replaying the failing requests from the usage traces against OpenCode:cache_control→ 400 (Extra inputs are not permitted … cache_control)tools: []→ 400 (tools must not be an empty array); without the empty list → 200Changes:
x-claude-code-session-id,x-session-id,x-session-affinity,x-opencode-session) is passed on to OpenCode.x-opencode-sessiononly for OpenCode Go (/zen/go), which refuses a request without it.toolslist is left out for OpenCode.Prompt caching without a session header was checked in #845: turns 2–5 hit ~23.5k/23.6k tokens.
🤖 Generated with BaoCode