fix: ensure that github copilot plugin properly sets headers when used in other clients than tui (#12316)

This commit is contained in:
Aiden Cline
2026-02-05 11:40:29 -06:00
committed by GitHub
parent dbde377ab0
commit fba5a79c45

View File

@@ -301,17 +301,20 @@ export async function CopilotAuthPlugin(input: PluginInput): Promise<Hooks> {
}, },
], ],
}, },
"chat.headers": async (input, output) => { "chat.headers": async (incoming, output) => {
if (!input.model.providerID.includes("github-copilot")) return 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" output.headers["anthropic-beta"] = "interleaved-thinking-2025-05-14"
} }
const session = await sdk.session const session = await sdk.session
.get({ .get({
path: { path: {
id: input.sessionID, id: incoming.sessionID,
},
query: {
directory: input.directory,
}, },
throwOnError: true, throwOnError: true,
}) })