Skip to content

fix(core): add namespaced session identity headers - #52368

Merged
rekram1-node merged 1 commit into
v2from
identity-headers
Sep 30, 2026
Merged

rekram1-node merged 1 commit into
v2from
identity-headers

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Issue for this PR

Closes #39912.

Also addresses #39912 (comment). This covers V2; the dev counterpart is #52370.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds two headers in V2's shared session model-request builder, for all providers:

  • x-opencode-session-id: the current session's actual ID, including child sessions.
  • x-opencode-parent-session-id: its immediate parent's ID, omitted for root sessions.

Existing headers and prompt-cache keys remain unchanged. Those can carry shared affinity IDs, so the new identity headers deliberately use session identity rather than affinity. The current-session header is emitted before parent headers so LiteLLM's first-match vendor-header scan sees it first.

How did you verify your code works?

  • 250 tests passed across session runner, title, compaction, and generation suites.
  • Root-session assertions check the exact header set, including omission of the parent header. Child-session assertions verify its own identity, parent linkage, and unchanged parent cache affinity.
  • bun run check (lint and workspace typechecks).

Screenshots / recordings

N/A — request metadata only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@rekram1-node
rekram1-node merged commit f46fa72 into v2 Sep 30, 2026
10 checks passed
@rekram1-node
rekram1-node deleted the identity-headers branch September 30, 2026 20:14
Ichinose-Kazuki pushed a commit to Ichinose-Kazuki/opencode that referenced this pull request Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant