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."); + }); +});