fix(core): restore session request headers - #43188
Merged
Merged
Conversation
alltomatos
pushed a commit
to alltomatos/opencode
that referenced
this pull request
Aug 18, 2026
1056674754
added a commit
to 1056674754/opencode
that referenced
this pull request
Aug 31, 2026
Upstream v1.18.18 (31406cc) -> v1.18.19 (2b72179), 70 commits. Functional changes: - feat(opencode): native OpenAI and Anthropic passthroughs for Cloudflare AI Gateway (anomalyco#42634) - fix(core): fall back on oversized websocket requests (anomalyco#43099) - fix: codex data residency (anomalyco#42432); match codex limits for openai models on chatgpt subscription (anomalyco#39082) - fix(core): preserve unicode in grep previews (anomalyco#42356) - fix(opencode): preserve v1 database compatibility (anomalyco#42444) - fix(core): restore session request headers (anomalyco#43188) - fix(opencode): enable web search for Go (anomalyco#42630) - fix(session): ignore malformed model costs (anomalyco#43248) - fix(opencode): properly show authed providers on /connect command (anomalyco#39915) - fix(opencode): remove Qwen sampling defaults (anomalyco#43310) - fix(provider): update Google Vertex SDK (anomalyco#43108) - fix(cli): update default console URL (anomalyco#43043) Conflicts resolved: 29 package.json version bumps (rebranded 1.18.19-sscity), bun.lock (took upstream, rebranded workspace entries via bun install). provider.ts, transform.ts, session.ts, tool/registry.ts, and transform.test.ts auto-merged cleanly: fork ProviderSnapshot refactor, GLM/ZhiPu normalization, tool registry hot reload, and session fixes are untouched; upstream Cloudflare passthrough (cloudflareGatewayNpm + native openai/anthropic routes), Qwen sampling removal, getUsage cost tolerance, and opencode-go websearch adopted alongside. v1.18.17 retry composition and v1.18.18 provider patches remain intact.
1a1a11a
added a commit
to HarvardMadSys/hybridInference
that referenced
this pull request
Sep 6, 2026
Neither client showed a session in the console. Both were checked against their own source rather than guessed at, and there were three causes. Current OpenCode stamps every request to a provider it does not recognise as its own with both X-Session-Id and x-session-affinity, set to the same ses_... id, plus x-parent-session-id on a subagent run; on its own provider it sends x-opencode-session instead. Kilo Code is an OpenCode fork and builds the same block. X-Session-Id was already the canonical source, so current builds were handled all along; the affinity and own-provider spellings are added beside it so one arriving without the other still names the session. x-parent-session-id is deliberately not read -- it names the session that spawned this one, and reading it would merge every subagent run into its parent. The header block lives in two runners. The newer one lost it and only got it back in anomalyco/opencode#43188 on 2026-08-18, and Kilo's vendored copy of that file still has no header block. On that path nothing on the wire names the session, and the gateway records none rather than inferring one from a field that was not meant to carry it. Neither client was even labelled, in two places. Their LLM requests identify as opencode/<version> and kilo/<channel>/<version>/<client>, which matched nothing in the console's parseClientTool nor in the copy of that table in analytics/automation_score.py -- so both fell through to the leading-token label and drew the unknown automation prior of 0.6 instead of the interactive 0.1, skewing their users' automation scores. Both tables now match, with the real user-agent shapes covered by tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WpETEerrhcCpsg69ucjrEt
1a1a11a
added a commit
to HarvardMadSys/hybridInference
that referenced
this pull request
Sep 6, 2026
Follow-up to #1371, correcting guidance that was wrong there. The console still showed no session for OpenCode and Kilo after #1371 reached staging. Claude Code and Codex rows do carry sessions, so the gateway side works end to end and the gap is entirely client-side. #1371 said to add a chat.headers plugin on the runner that sends no headers. That is useless in both directions. The hook exists only on the older packages/opencode/src/session/llm/request.ts path, which already builds the header block itself; the newer core runner (packages/core/src/session/runner/llm.ts, registered as SessionRunnerLLM.node in location-services.ts) has neither the header block nor any plugin hook. Where the hook exists nothing needs fixing, and where the headers are missing there is nothing to hook. Both paths were checked against the sst/opencode and Kilo-Org/kilocode trees rather than inferred. The text now names them and the registration site so a reader can confirm it quickly, and gives the two real remedies: upgrade OpenCode past anomalyco/opencode#43188, and port that same change into the Kilo fork, which branched before the restore. Docs only. The zh_CN catalog carries both rewritten paragraphs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WpETEerrhcCpsg69ucjrEt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
x-session-affinityandX-Session-Idon V2 core runner provider requestsx-parent-session-idfor child sessionsThe dedicated
v2branch already has this behavior from #36975. This ports the missing behavior todev, whose shared core runner is used by the affected current releases.Closes #42694
Validation
bun test test/session-runner.test.tsinpackages/core(87 passed)bun testinpackages/core(1091 passed)bun typecheckinpackages/core