feat: send x-opencode-session header for OpenCode Go/Zen providers - #5868
feat: send x-opencode-session header for OpenCode Go/Zen providers#5868huangxianzhan wants to merge 1 commit into
Conversation
|
Thanks @huangxianzhan for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
Replaces the earlier commit whose blob carried CRLF line endings, producing a noisy full-file diff. Same code: process-stable x-opencode-session UUID v4 for OpencodeGo/OpencodeZen in build_default_headers, user-configured header wins, three unit tests.
7faf58e to
4a2d296
Compare
The OpenCode Go and Zen gateways ask clients for a stable `x-opencode-session` header so the service can optimize prompt caching and attribute traffic to one conversation. One UUID v4 per process gives every request from a session the same id; a user-configured header of the same name still wins, because the extra-header loop runs after this insert. Harvested rather than merged: the submitted branch had `client.rs` saved with CRLF line endings, so a 98-line change arrived as a 24,000-line whole-file rewrite that would have flipped the file's line endings for every other contributor. This is the author's exact change and their test, applied to the LF file. `client.rs` was untouched on main since their branch point, so the normalized content is theirs line for line. Their test `opencode_go_and_zen_requests_carry_stable_session_header` passes (1/1), asserting both that the header is present for each gateway and that a second request from the same process reuses the id. Gates: cargo fmt --all --check CLEAN · nextest -p codewhale-tui test(opencode) 18 passed / 0 failed. Co-authored-by: huangxianzhan <264075734+huangxianzhan@users.noreply.github.com> Harvested-from: PR Hmbown#5868 by @huangxianzhan Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCLLenseqfQdVaZUBqn9yG
0.9.12 had no `### Contributors` section, `web/lib/release-credits.ts` still held the 0.9.11 cohort, and the contributor doc band was missing five people whose work landed. Three surfaces that must agree, disagreeing three ways. Everyone whose work reached main this cycle is now named in all three, derived from `Co-authored-by` and `Harvested-from` trailers on v0.9.11..HEAD rather than from memory. The five who were missing: - @qiuYliangM (秋月凉梦) — co-author on Hmbown#5621, Hmbown#5622, Hmbown#5623 - @whp233 — Hmbown#5716, landed as Hmbown#5719 - @Gabriel-Degret — Hmbown#5867 - @huangxianzhan — Hmbown#5868 - @zhuowp — Hmbown#5869 @aboimpinto's entry gained Hmbown#5825 and Hmbown#5865, @M-Maciej's gained Hmbown#5533/Hmbown#5831. `requiredCandidateCredits` in public-surface-facts.json moves from the 0.9.11 cohort to this one — that guard is meant to hold the *current* release's credits in every surface, and it had been pinning the previous release's. `RELEASE_HELPERS` is deliberately empty. Every credited contribution this cycle arrived as code that landed; a name there that no landed change can point at would be a nicer-looking ledger and a less true one. AUTHOR_MAP gains canonical numeric-noreply identities for all five, since the trailers on their harvest commits used raw emails and old-style noreply addresses. web: 386 tests, 386 passed. check:facts, check:docs, check:tokens, check:locales all PASS. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCLLenseqfQdVaZUBqn9yG
|
Closing with credit: this change landed on main as 2ad300fff4 ( |
What
OpenCode Go (https://opencode.ai/docs/go/) asks clients to send a stable \x-opencode-session\ header so it can optimize prompt caching and attribute traffic to a conversation. Codewhale requests were missing it, and the client UA (Mozilla/5.0 compatible codewhale/...) gets classified as a plain browser on the gateway; traffic without the header may error starting 2026-09-06.
Changes
Verification