What this thread does
Do first: Upgrade Goose to v1.51.0 (released 2026-09-17), the first stable release carrying the built-in opencode_go session-header fix.
Symptom
Request is missing x-opencode-session and cannot be routed efficiently. appears in a provider HTTP 400 response when Goose sends requests through its built-in opencode_go provider. erflores-tech reported it on Windows with Goose CLI 1.49.0.
Other users commented on the issue: entitybtw offered gateway advice, and costynus reported the same issue and offered to implement the header change.
Cause
Goose's built-in provider omitted the session header OpenCode Go needed for routing. Updating the standalone OpenCode CLI did not change Goose's own provider requests. The merged PR #11944 changes the header selection so this provider sends the current Goose session ID as x-opencode-session, while other OpenAI-compatible providers retain agent-session-id.
Fix
1. Upgrade Goose to the release containing the change: v1.51.0, released 2026-09-17. 2. Use the built-in opencode_go provider; the session ID header is supplied by Goose rather than a manually chosen header value. PR #11944 describes this behavior.
As of November 2026, the stable release is v1.60.2, published 2026-11-20. Its provider definition still selects x-opencode-session; its provider construction passes that selection to the session request decorator. The decorator inserts the current session ID when one is available.
Fixed in
First stable carrying release: v1.51.0 (released 2026-09-17). PR #11944, by costynus, merged on 2026-09-09.
If you cannot upgrade: the issue reporter suggested temporarily switching Goose to a different provider, such as ollama_cloud. This is a reporter-supplied workaround, not a change to the built-in OpenCode Go header handling.
If it still fails
- The change supplies the session header only when a current Goose session ID is available; the v1.60.2 decorator does not invent one when it is absent.
- This fix concerns the built-in
opencode_gorequest path. The merged PR does not establish a remedy for every provider HTTP 400 response.
Not for: the standalone OpenCode CLI; upgrading that separate CLI does not update Goose's built-in provider.
Sources
- opencode_go provider fails: missing x-opencode-session header (400 error), erflores-tech, opened 2026-09-07; closed as completed on 2026-09-09: "Request is missing x-opencode-session and cannot be routed efficiently."
- entitybtw comment, entitybtw, 2026-09-08; parent issue closed as completed on 2026-09-09.
- costynus comment, costynus, 2026-09-08; parent issue closed as completed on 2026-09-09.
- fix: send session ID header for OpenCode Go, costynus, merged 2026-09-09.
- v1.51.0, published 2026-09-17.
- v1.60.2, published 2026-11-20.
- v1.60.2 provider definition, provider construction, and session decorator, release-tagged source read 2026-11-24.
Checked
2026-11-24; read GitHub API records for issue #11900 and its comments, PR #11944 and its changed files, releases v1.51.0 and v1.60.2 and the latest-release record; read the v1.60.2 provider definition, provider construction and session decorator; no command was run.
Started from a post by @erflores-tech, packaged by the editor. Original post