You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode-go: requests have no x-opencode-session and no User-Agent, and the provider refuses them (400 MissingSessionID) #4
A run on opencode-go/deepseek-v4.1-flash gets this answer from the provider:
400 {"type":"MissingSessionID","message":"Request is missing x-opencode-session and cannot be routed efficiently. Please see https://opencode.ai/docs/go/#where-can-i-use-it"}
The credential resolves and broca admits the run. The provider refuses the first request after about 1 s, with 0 tokens. Thus each opencode-go run through broca fails.
Version: v0.3.249 (6368883). The related files are the same on master.
Identify itself with its own user agent, such as my-coding-agent/1.0, not with a generic SDK or HTTP-library name.
Send a stable session ID in x-opencode-session for each conversation.
What broca sends
The catalog overlay sends opencode-go through the openai_chat family (crates/broca-catalog/data/overlay.json:851-856).
The openai_chat endpoint sets only content-type, accept, and the auth header (crates/broca-provider/src/families/openai_chat.rs:64-95).
The provider HTTP client does not set a User-Agent (crates/broca-provider/src/transport.rs:592).
The request context has a per-session address (transport.rs:211, :461), but the openai_chat family does not send it as a header.
Proposed fix
For the opencode-go provider:
Send x-opencode-session with a value that is stable for one broca session, for example the session address.
Send a broca User-Agent. The Anthropic family already has broca/<version> (BROCA_USER_AGENT, crates/broca-provider/src/families/anthropic_messages.rs:60).
Related: per-model endpoints and formats (from the provider documentation, not tested)
The OpenCode Go documentation (https://opencode.ai/docs/go/#endpoints) gives a different endpoint and request format for different models. The base is https://opencode.ai/inference/go/:
Models
Endpoint path
Format
DeepSeek, GLM, Kimi, MiMo, LongCat, Hy, Step, MiniMax M3.1 Flash
openai/v1/chat/completions
OpenAI chat
GPT 6 Luna, GPT 5.6 Luna, Grok 4.7, Muse Spark
openai/v1/responses
OpenAI responses
Claude Haiku 5.5, Qwen3.x, MiniMax M3
anthropic/v1/messages
Anthropic messages
Gemini 4 Argon Contributor
google/v1beta/models/<model>
Google
broca sends each opencode-go model as openai_chat to https://opencode.ai/zen/go/v1 (crates/broca-catalog/data/overlay.json:851-856). The chat-completions models agree with this. For the other models, the format possibly does not agree.
This comes only from the documentation. I did not test it. A test request is possible only after the header fix in this issue, because the provider refuses each request before that.
Activity
iceteaSA commentedon Oct 23, 2026
Related: per-model endpoints and formats (from the provider documentation, not tested)
The OpenCode Go documentation (https://opencode.ai/docs/go/#endpoints) gives a different endpoint and request format for different models. The base is
https://opencode.ai/inference/go/:openai/v1/chat/completionsopenai/v1/responsesanthropic/v1/messagesgoogle/v1beta/models/<model>broca sends each
opencode-gomodel asopenai_chattohttps://opencode.ai/zen/go/v1(crates/broca-catalog/data/overlay.json:851-856). The chat-completions models agree with this. For the other models, the format possibly does not agree.This comes only from the documentation. I did not test it. A test request is possible only after the header fix in this issue, because the provider refuses each request before that.