Q78: GitHub Copilot turns carry the agent's system instructions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-08 13:06:16 -04:00
1 parent d557e42676
commit 5d5bc802e9
2 files changed
+13 -1

No files matched your search

@@ -164,6 +164,7 @@ export async function runCopilotTurn(input: ProviderToolTurnInput): Promise<Agen
tools: responsesToolDefs(input.tools),
tool_choice: "auto",
store: false,
...(input.instructions ? { instructions: input.instructions } : {}),
};
const response = await postJson(`${baseUrl}/responses`, {
Authorization: `Bearer ${access}`,
+12 -1
View File
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test, vi } from "vitest";
import { providerAdapters } from "../../src/main/services/provider-adapters";
import { makeChatCompletionsTurn } from "../../src/main/services/provider-tool-turns/turns";
import { makeChatCompletionsTurn, runCopilotTurn } from "../../src/main/services/provider-tool-turns/turns";
const bodies: Array<Record<string, unknown>> = [];
@@ -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<string, unknown>);
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.");
});
});