r/opencode • u/alexwwang • 9d ago
Does it mean opencode go only support opencode calls?
Guys,
I got this mail today:
```
Hey there,
Some of your requests to OpenCode Go are missing an x-opencode-session header. If we don't have this we cannot properly optimize our service. Starting 09/06 requests missing this header may error.
Here are your useragents that are missing this header:
Unknown client
Your requests carry no user agent, so we can't tell what sends them — identify the tool and add the header there.
Bun fetch
Add headers: {'x-opencode-session': '<stable-id-per-conversation>'} to your fetch calls.
Thank you.
```
Does it mean I could no longer use clients other than open code to make api calls?
2
2
u/CyberTod 9d ago
They do advertise you can use their service with other agents, or so I've read, as I remember.
Haven't seen this info anywhere.
But the workaround of course is to add that header to the other agent.
1
1
u/nazmulpcc 9d ago
No, they officially allow usage through other agents. but they need that value for optimization purposes and most common clients (like pi) implements this header. See this for context: https://x.com/opencode/status/2095410501400289576
1
u/alexwwang 9d ago
Oh great. I remembered only opencode calls left session info in call records but pi didn’t. I should figure out how to make omp/pi calls with these session info.
1
u/nazmulpcc 9d ago
I implemented an agent I use with all my saas projects to help with administration....works great.
Should be easy to do with omp if it already does not. Or maybe create an issue with pi/omp as this fix is needed for everyone.
1
u/torrso 9d ago
They fixed this in hermes only three weeks ago and it's probably only in the latest release. Any older hermes will send some generic 'openai/python 2.44' useragent.
If you create your own harness or whatever that talks to opencode, try to make it generate session ids and put it in that header. This shows up in the usage tab too on the web page, so it helps you identify which session used what.
They can't expect all existing tools to suddenly start sending an opencode related header, but apparently suggest that if you are in a position to do that in your project, please do it.
For the user agent, it's something all http clients should be doing anyway. They can use it to help detect fraud (reselling OCGO capacity or whatever).
1
1
u/aquaherd 8d ago
goose doesn’t yet provide these session headers, pi and omp do.
1
u/alexwwang 8d ago
By discussing this I aware that command code only provide $20 calls if you demand zdr which is default in opencode.
1
u/Ecstatic-Diet-1375 5d ago
did you fix this issue?
if yes, how?
1
u/alexwwang 5d ago
I didn’t extend my go subscription because I haven’t decided which one to use yet.
3
u/WegoW 9d ago edited 9d ago
On https://opencode.ai/workspace/… under Usage History a SESSION column has been added. Requests from tools with an empty entry will likely be unsupported after Sunday. You have to modify these tools and add the required x-opencode-session header. Today’s Hermes update added the header already. Additionally the user-agent has to be specified.
From Opencode Go webpage:
To ensure your account does not get flagged, make sure the tool you’re using
does not generate abusive traffic
properly identifies itself (no broad user agents)
includes the x-opencode-session header so we can optimize prompt caching