Explorar el Código

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

Aiden Cline hace 2 semanas
padre
commit
fba5a79c45
Se han modificado 1 ficheros con 7 adiciones y 4 borrados
  1. 7 4
      packages/opencode/src/plugin/copilot.ts

+ 7 - 4
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,
         })