feat: Send x-session-affinity and x-parent-session-id headers (#20744)

pull/20929/head
Kevin Flansburg 2026-04-02 21:09:53 -06:00 committed by GitHub
parent aa2239d5de
commit e89527c9f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,7 @@ export namespace LLM {
export type StreamInput = {
user: MessageV2.User
sessionID: string
parentSessionID?: string
model: Provider.Model
agent: Agent.Info
permission?: Permission.Ruleset
@ -301,6 +302,8 @@ export namespace LLM {
"x-opencode-client": Flag.OPENCODE_CLIENT,
}
: {
"x-session-affinity": input.sessionID,
...(input.parentSessionID ? { "x-parent-session-id": input.parentSessionID } : {}),
"User-Agent": `opencode/${Installation.VERSION}`,
}),
...input.model.headers,

View File

@ -1512,6 +1512,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
agent,
permission: session.permission,
sessionID,
parentSessionID: session.parentID,
system,
messages: [...modelMsgs, ...(isLastStep ? [{ role: "assistant" as const, content: MAX_STEPS }] : [])],
tools,