Skip to content

fix(core): share child session affinity headers - #51923

Merged
rekram1-node merged 1 commit into
v2from
child-affinity-headers
Sep 28, 2026
Merged

rekram1-node merged 1 commit into
v2from
child-affinity-headers

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Follow-up to #50495, which made child sessions use the parent's ID for prompt_cache_key but left the session headers on the child's own ID. Routers that use the headers, not the body key, still sent sibling subagents to different machines.

x-session-affinity, X-Session-Id, and x-opencode-session now use the same affinity value as promptCacheKey: the parent ID, then the fork root, then the session's own ID. x-parent-session-id still carries the parent ID.

Zen reads x-opencode-session for sticky provider routing and for per-session usage, so subagent usage now counts toward the parent session there.

Verified with the core session runner, compaction, title, and generate tests, plus bun typecheck in packages/core.

@rekram1-node
rekram1-node merged commit 6cf442b into v2 Sep 28, 2026
10 checks passed
@rekram1-node
rekram1-node deleted the child-affinity-headers branch September 28, 2026 18:31
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