summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2026-02-05 11:40:29 -0600
committerGitHub <[email protected]>2026-02-05 11:40:29 -0600
commitfba5a79c45716989dc0f70d8960324d2a6455b1b (patch)
treebcb860ef662f0e857d15c1e4f5dc92cbf180d1e5
parentdbde377ab0a5bef51b3814c13b4cf6605ffbfbcb (diff)
downloadopencode-fba5a79c45716989dc0f70d8960324d2a6455b1b.tar.gz
opencode-fba5a79c45716989dc0f70d8960324d2a6455b1b.zip
fix: ensure that github copilot plugin properly sets headers when used in other clients than tui (#12316)
-rw-r--r--packages/opencode/src/plugin/copilot.ts11
1 files 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<Hooks> {
},
],
},
- "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,
})