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
Prompt cache misses ~10x higher without prompt_cache_key: ZCode 3.36% vs Codex 0.30% on the same Go endpoint #51580
ZCode 3.14.3 and Codex CLI both hit the same Go endpoint (zen/go/v1, deepseek-v4.1-flash) on my machine. Counting per-request cache hits from logs (Sep 25–27):
Miss = cache_read < 5% of input, input > 10k. On the ZCode side a miss is a single request between ~99% hits: cache_read drops to 0/1024/1152 (always multiples of 128) while input is 90k–520k, then recovers on the next request. ZCode sends a stable x-opencode-session (verified: 1225 requests, 22 sessions, no drift), but its body has no cache routing key — only model/messages/max_tokens/reasoning_effort. Codex sends prompt_cache_key (per OpenAI's prompt caching docs).
So it looks like the session header alone isn't enough for sticky cache routing. Does Go use prompt_cache_key when present? If yes, could it be documented next to x-opencode-session in the Go guide? Raw per-request tables available if needed.
Plugins
N/A
OpenCode version
N/A (not the opencode CLI) — ZCode 3.14.3 and Codex CLI v0.157.1
Steps to reproduce
Point both clients at zen/go/v1 on the same machine.
Log input_tokens / cache_read_tokens per request.
Count requests with cache_read < 5% of input (input > 10k): ZCode 23/685, Codex 2/657.
Thanks for the careful measurements, @ykk-deadsd. A cache miss rate about 10x higher than Codex on the same Go endpoint is a real cost, and the per-request breakdown is very useful.
How the hosted OpenCode Go service routes requests and uses cache keys is handled by the team that runs it, not by the OpenCode app code in this repository. Support for Go and its usage isn't handled in GitHub issues. Please email [email protected] with your comparison report and the raw per-request tables. If you've already emailed, the team will get to it, especially now that we've seen it here. Please keep API keys, account emails and any account or payment details out of this public issue and put them in the email instead.
For reference: OpenCode itself sends both the x-opencode-session header and a prompt_cache_key built from the same session ID. The current Go guide only mentions the session header, and says Go recognizes ZCode's native session header. I can't confirm from here which of the two the gateway uses for routing.
I'm closing this now, @ykk-deadsd. Questions about how the OpenCode Go service routes requests and uses cache keys, like whether it reads prompt_cache_key, are handled by email rather than in GitHub issues. If this is still open for you, please email [email protected] with your comparison report and the raw per-request tables. Please keep API keys, account emails and any account details out of this public issue. Thanks again for the careful measurements.
Activity
github-actions commentedon Sep 27, 2026
This issue might be a duplicate of existing issues. Please check:
prompt_cache_keyprovides sticky cache routing.opencodejr commentedon Oct 28, 2026
Thanks for the careful measurements, @ykk-deadsd. A cache miss rate about 10x higher than Codex on the same Go endpoint is a real cost, and the per-request breakdown is very useful.
How the hosted OpenCode Go service routes requests and uses cache keys is handled by the team that runs it, not by the OpenCode app code in this repository. Support for Go and its usage isn't handled in GitHub issues. Please email [email protected] with your comparison report and the raw per-request tables. If you've already emailed, the team will get to it, especially now that we've seen it here. Please keep API keys, account emails and any account or payment details out of this public issue and put them in the email instead.
For reference: OpenCode itself sends both the
x-opencode-sessionheader and aprompt_cache_keybuilt from the same session ID. The current Go guide only mentions the session header, and says Go recognizes ZCode's native session header. I can't confirm from here which of the two the gateway uses for routing.Related reports about Go caching:
reasoning_effortbeing part of the prefix cache keyThe bot will close this issue in 1 day, since this needs to go through email support.
opencodejr commentedon Oct 29, 2026
I'm closing this now, @ykk-deadsd. Questions about how the OpenCode Go service routes requests and uses cache keys, like whether it reads
prompt_cache_key, are handled by email rather than in GitHub issues. If this is still open for you, please email [email protected] with your comparison report and the raw per-request tables. Please keep API keys, account emails and any account details out of this public issue. Thanks again for the careful measurements.