From fba5a79c45716989dc0f70d8960324d2a6455b1b Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Thu, 5 Feb 2026 11:40:29 -0600 Subject: [PATCH] fix: ensure that github copilot plugin properly sets headers when used in other clients than tui (#12316) --- packages/opencode/src/plugin/copilot.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/opencode/src/plugin/copilot.ts b/packages/opencode/src/plugin/copilot.ts index ef41ee38d..39ea0d00d 100644 --- a/packages/opencode/src/plugin/copilot.ts +++ b/packages/opencode/src/plugin/copilot.ts @@ -301,17 +301,20 @@ export async function CopilotAuthPlugin(input: PluginInput): Promise { }, ], }, - "chat.headers": async (input, output) => { - if (!input.model.providerID.includes("github-copilot")) return + "chat.headers": async (incoming, output) => { + if (!incoming.model.providerID.includes("github-copilot")) return - if (input.model.api.npm === "@ai-sdk/anthropic") { + if (incoming.model.api.npm === "@ai-sdk/anthropic") { output.headers["anthropic-beta"] = "interleaved-thinking-2025-05-14" } const session = await sdk.session .get({ path: { - id: input.sessionID, + id: incoming.sessionID, + }, + query: { + directory: input.directory, }, throwOnError: true, })