fix(opencode-go): preserve sessions across all Go model wires - #76
Merged
Merged
Conversation
pavelhov
approved these changes
Sep 28, 2026
pavelhov
left a comment
Owner
There was a problem hiding this comment.
Reviewed the canonical OpenCode Go transport and all three wire paths. The Claude Code Messages session gap was fixed and independently reviewed. Session values are opaque hashes, attach only to the canonical fixed-key Go destination, and configured headers retain precedence. Focused tests, typecheck, privacy scan, docs build, and all 630 local test files pass on fec4910; awaiting the amended CI run before merge.
This was referenced Sep 28, 2026
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.
Why
OpenCode Go requires a stable session identifier for each conversation. CodexCommander routes Go models over Chat Completions, Anthropic Messages, and OpenAI Responses; a missing
x-opencode-sessionon any of these paths makes upstream requests fail withMissingSessionID. The fix belongs to the canonical Go provider transport so it applies to every supported Go model, including Codex subagents.Changes
x-opencode-sessionfrom the Codex task/session ID for the canonical Go provider, across all three documented wire formats. Sibling subagents get distinct IDs; sessionless requests get isolated temporary IDs. Preserve an operator-configured header and identify the proxy with its own user agent.deepseek-v4.1-flash,glm-5.3-flash,qwen3.8-flash) and their documented wire and capability metadata. The transport fix itself has no model-ID allowlist.Validation
bun test tests/opencode-go-session.test.ts tests/opencode-go-catalog.test.ts tests/opencode-go-deepseek.test.ts tests/provider-registry-parity.test.ts— 56 passed.bun run typecheck— passed.bun run privacy:scan— passed.cd docs-site && bun run build— passed.deepseek-v4.1-flash,glm-5.2,glm-5.3-flash,qwen3.8-max,qwen3.8-flash, andgpt-5.6-luna— all returned HTTP 200 with completedOKanswers. Together they cover Chat Completions, Anthropic Messages, and OpenAI Responses.bun run test:parallel— all 630 files passed locally on the amended commit, including the runner's same-mode retries. GitHub CI is rechecking the amended head.Security considerations
The header contains a scoped SHA-256 digest rather than a raw Codex task ID or Claude metadata value. It is added only for the canonical fixed-key OpenCode Go destination. Configured provider headers retain precedence. The new Messages path does not forward raw metadata or credentials to Go. The change does not modify authentication, credentials, or request logging.