Skip to content

fix(opencode): add namespaced session identity headers - #52370

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

rekram1-node merged 1 commit into
devfrom
identity-headers-v1

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). Dev counterpart of the V2 PR #52368.

Type of change

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

What does this PR do?

Adds x-opencode-session-id for the current session's actual ID and x-opencode-parent-session-id for its immediate parent, omitted for roots. Both the legacy provider-aware request builder and the core runner emit them, including custom-provider requests.

Existing headers, cache keys, routing, and configured/plugin header overrides remain unchanged. The current-session header comes before parent headers for LiteLLM's first-match vendor-header scan.

How did you verify your code works?

  • 33 tests passed in the legacy LLM suite, including root/child requests on OpenCode and custom providers and preservation of legacy headers.
  • 87 tests passed in the core session runner suite.
  • bun typecheck passed in packages/opencode and packages/core.
  • Changed-file lint passed with warnings. Full-repo lint fails on an existing octal escape in packages/session-ui/src/v2/components/prompt-input/index.tsx:163, unchanged by this PR.

Screenshots / recordings

N/A — request metadata only.

Checklist

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

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.

X-Session-Id not recognized by LiteLLM / observability tools — should follow x-<vendor>-session-id convention

1 participant