Skip to content

fix(opencode): send parent session header - #44752

Merged
rekram1-node merged 2 commits into
devfrom
v1-parent-header
Aug 24, 2026
Merged

fix(opencode): send parent session header#44752
rekram1-node merged 2 commits into
devfrom
v1-parent-header

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

  • send x-parent-session-id for child sessions using OpenCode-managed providers
  • preserve the existing header behavior for all other providers
  • cover the OpenCode provider path with an outbound request regression test

Checks

  • bun test test/session/llm.test.ts --timeout 30000
  • bun x prettier --check src/session/llm/request.ts test/session/llm.test.ts
  • git diff --check

Requester attribution: @rekram1-node (Aiden via Slack)

@rekram1-node
rekram1-node merged commit 611cc73 into dev Aug 24, 2026
6 of 8 checks passed
@rekram1-node
rekram1-node deleted the v1-parent-header branch August 24, 2026 20:24
Anonymouse8882 pushed a commit to Anonymouse8882/opencode that referenced this pull request Aug 27, 2026
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
(cherry picked from commit 611cc73)
Archipel pushed a commit to Archipel/opencode that referenced this pull request Aug 29, 2026
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
1056674754 added a commit to 1056674754/opencode that referenced this pull request Aug 31, 2026
Upstream v1.18.22 (47b6b6f, merged at 2686e4c) -> v1.18.23 (ef2880f),
13 commits / 46 files. Upstream superseded the v1.18.22 release commit with
55f9841 (sync release versions for v1.18.22) in the v1.18.23 lineage; merge
base is 2a6be0a (chore: generate), effective input identical to the audited
13-commit range.

Functional changes:
- fix(provider): route non-native Cloudflare AI Gateway providers via the
  REST API (anomalyco#44828) — adopted onto fork provider.ts; the custom cloudflare
  loader region was untouched by the fork snapshot architecture, so the
  change auto-merged. Third-party models (google, xai, deepseek, ...) now
  point an OpenAI-compatible client at the Cloudflare REST endpoint
  (api.cloudflare.com/client/v4/accounts/<id>/ai/v1) bound with
  cf-aig-gateway-id, keeping requests gateway-routed; Workers AI keeps the
  unified compat route with the Cloudflare token as upstream Authorization.
- fix(provider): send Anthropic's dashed native slug through the AI Gateway
  (anomalyco#44281) — anthropic/<id> models translate dotted versions to dashes
  (claude-haiku-4.5 -> claude-haiku-4-5) before the native Messages
  passthrough; OpenAI dotted ids untouched.
- fix(opencode): send parent session header (anomalyco#44752) — x-parent-session-id
  moved to the provider-independent header level so opencode providers also
  send it; session routing headers (x-session-affinity/X-Session-Id) and
  opencode x-opencode-* headers unchanged.
- fix(github): support immutable OIDC subjects (anomalyco#44776) — token exchange
  reads the repository claim via new parseRepositoryClaim
  (packages/function/src/github.ts + 5 tests) instead of parsing the
  subject, so immutable subjects (repo:owner@id/repo@id) resolve;
  exchange failures return 502 with context; github.handler.ts guards
  error reporting behind GitHub client readiness and reports raw text on
  token-exchange failure.
- console: zen inference header lifecycle ($client replacement, keep
  x-opencode-* headers on new inference), requestBody nested-model parsing
  + tests, revert of the first-month-50 coupon delay, legal/prompt-data
  docs; docs(github.mdx) action token configuration.

Conflicts resolved: 29 package.json version bumps (rebranded 1.18.23-sscity),
bun.lock (took upstream, rebranded workspace entries via bun install).
provider.ts and request.ts auto-merged; provider.ts verified to differ from
pre-merge fork HEAD only by the Cloudflare changes — fork snapshot /
small-model-chain / session-pinning / GLM architecture untouched.
packages/function/package.json adopted upstream's new "test" script, wiring
the new github tests into turbo alongside the new @opencode-ai/function#test
task. Tests from both sides kept: provider 105, transform 437, retry 68,
run-process 15, session llm 30 (incl. new parent session header test),
cf-ai-gateway-e2e 13 (incl. dashed-slug and REST-route assertions), function
github 5 (new), console requestBody 6 all pass; typecheck 30/30.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant