From 5d5bc802e9c914b6d335bd0a23f9959922668d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 8 Oct 2026 13:06:16 -0400 Subject: [PATCH] Q78: GitHub Copilot turns carry the agent's system instructions Co-Authored-By: Claude Opus 5.5 --- src/main/services/provider-tool-turns/turns.ts | 1 + tests/unit/stream-usage-request.test.ts | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/services/provider-tool-turns/turns.ts b/src/main/services/provider-tool-turns/turns.ts index 8b7af38a..3dcc9039 100644 --- a/src/main/services/provider-tool-turns/turns.ts +++ b/src/main/services/provider-tool-turns/turns.ts @@ -164,6 +164,7 @@ export async function runCopilotTurn(input: ProviderToolTurnInput): Promise> = []; @@ -30,3 +30,14 @@ describe("stream usage requests", () => { expect(bodies.at(-1)?.stream_options).toEqual({ include_usage: true }); }); }); + +describe("system instructions", () => { + test("the GitHub Copilot turn sends the agent's instructions like every other Responses turn", async () => { + vi.stubGlobal("fetch", async (_url: string, init: RequestInit) => { + bodies.push(JSON.parse(String(init.body)) as Record); + return new Response(JSON.stringify({ output: [{ type: "message", content: [{ type: "output_text", text: "ok" }] }] }), { status: 200, headers: { "content-type": "application/json" } }); + }); + await runCopilotTurn({ credential: { accessToken: "tid=1;exp=9999999999" }, model: "gpt-5.4", instructions: "You are Ada, the backend engineer.", messages: [{ role: "user", text: "hi" }], tools: [] }); + expect(bodies.at(-1)?.instructions).toBe("You are Ada, the backend engineer."); + }); +});