feat: Send x-session-affinity and x-parent-session-id headers (#20744)
This commit is contained in:
@@ -25,6 +25,7 @@ export namespace LLM {
|
|||||||
export type StreamInput = {
|
export type StreamInput = {
|
||||||
user: MessageV2.User
|
user: MessageV2.User
|
||||||
sessionID: string
|
sessionID: string
|
||||||
|
parentSessionID?: string
|
||||||
model: Provider.Model
|
model: Provider.Model
|
||||||
agent: Agent.Info
|
agent: Agent.Info
|
||||||
permission?: Permission.Ruleset
|
permission?: Permission.Ruleset
|
||||||
@@ -301,6 +302,8 @@ export namespace LLM {
|
|||||||
"x-opencode-client": Flag.OPENCODE_CLIENT,
|
"x-opencode-client": Flag.OPENCODE_CLIENT,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
|
"x-session-affinity": input.sessionID,
|
||||||
|
...(input.parentSessionID ? { "x-parent-session-id": input.parentSessionID } : {}),
|
||||||
"User-Agent": `opencode/${Installation.VERSION}`,
|
"User-Agent": `opencode/${Installation.VERSION}`,
|
||||||
}),
|
}),
|
||||||
...input.model.headers,
|
...input.model.headers,
|
||||||
|
|||||||
@@ -1512,6 +1512,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
|||||||
agent,
|
agent,
|
||||||
permission: session.permission,
|
permission: session.permission,
|
||||||
sessionID,
|
sessionID,
|
||||||
|
parentSessionID: session.parentID,
|
||||||
system,
|
system,
|
||||||
messages: [...modelMsgs, ...(isLastStep ? [{ role: "assistant" as const, content: MAX_STEPS }] : [])],
|
messages: [...modelMsgs, ...(isLastStep ? [{ role: "assistant" as const, content: MAX_STEPS }] : [])],
|
||||||
tools,
|
tools,
|
||||||
|
|||||||
Reference in New Issue
Block a user