fix(core): send session ID with Copilot requests (#47213)

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot]
2026-09-05 18:42:46 -05:00
committed by GitHub
Unverified
parent 8da7526616
commit aa48433fa0
2 changed files with 19 additions and 6 deletions
@@ -261,6 +261,7 @@ export const GithubCopilotPlugin = define({
.pipe(Effect.orElseSucceed(() => undefined))
const interaction = interactionType(evt.kind, session?.parentID !== undefined)
evt.headers["X-Interaction-Type"] = interaction
evt.headers["X-Interaction-Id"] = evt.sessionID
if (interaction !== "conversation-agent") evt.headers["x-initiator"] = "agent"
}),
{ providerID: Provider.ID.githubCopilot },
@@ -175,7 +175,7 @@ describe("GithubCopilotPlugin", () => {
Effect.gen(function* () {
yield* addPlugin()
const event = yield* modelRequest((yield* sessions()).parent, "primary")
expect(event.headers).toEqual({ "X-Interaction-Type": "conversation-agent" })
expect(event.headers).toEqual({ "X-Interaction-Type": "conversation-agent", "X-Interaction-Id": event.sessionID })
}),
)
@@ -183,7 +183,11 @@ describe("GithubCopilotPlugin", () => {
Effect.gen(function* () {
yield* addPlugin()
const event = yield* modelRequest((yield* sessions()).child, "primary")
expect(event.headers).toEqual({ "X-Interaction-Type": "conversation-subagent", "x-initiator": "agent" })
expect(event.headers).toEqual({
"X-Interaction-Type": "conversation-subagent",
"X-Interaction-Id": event.sessionID,
"x-initiator": "agent",
})
}),
)
@@ -191,7 +195,11 @@ describe("GithubCopilotPlugin", () => {
Effect.gen(function* () {
yield* addPlugin()
const event = yield* modelRequest((yield* sessions()).parent, "title")
expect(event.headers).toEqual({ "X-Interaction-Type": "conversation-background", "x-initiator": "agent" })
expect(event.headers).toEqual({
"X-Interaction-Type": "conversation-background",
"X-Interaction-Id": event.sessionID,
"x-initiator": "agent",
})
}),
)
@@ -199,7 +207,11 @@ describe("GithubCopilotPlugin", () => {
Effect.gen(function* () {
yield* addPlugin()
const event = yield* modelRequest((yield* sessions()).child, "compaction", "build")
expect(event.headers).toEqual({ "X-Interaction-Type": "conversation-compaction", "x-initiator": "agent" })
expect(event.headers).toEqual({
"X-Interaction-Type": "conversation-compaction",
"X-Interaction-Id": event.sessionID,
"x-initiator": "agent",
})
}),
)
@@ -207,7 +219,7 @@ describe("GithubCopilotPlugin", () => {
Effect.gen(function* () {
yield* addPlugin()
const event = yield* modelRequest((yield* sessions()).parent, "primary", "compaction")
expect(event.headers).toEqual({ "X-Interaction-Type": "conversation-agent" })
expect(event.headers).toEqual({ "X-Interaction-Type": "conversation-agent", "X-Interaction-Id": event.sessionID })
}),
)
@@ -252,7 +264,7 @@ describe("GithubCopilotPlugin", () => {
Effect.gen(function* () {
yield* addPlugin()
const event = yield* modelRequest((yield* sessions()).parent, "generate")
expect(event.headers).toEqual({ "X-Interaction-Type": "conversation-agent" })
expect(event.headers).toEqual({ "X-Interaction-Type": "conversation-agent", "X-Interaction-Id": event.sessionID })
}),
)