fix: ensure that github copilot plugin properly sets headers when used in other clients than tui (#12316)
This commit is contained in:
@@ -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,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user