diff --git a/.github/fixtures/pi-gateway.ts b/.github/fixtures/pi-gateway.ts index cbe19e9..927a180 100644 --- a/.github/fixtures/pi-gateway.ts +++ b/.github/fixtures/pi-gateway.ts @@ -45,6 +45,8 @@ export function piGateway(value: unknown) { api, baseUrl, reasoning: definition["reasoning"] === true, + // Copilot's Responses endpoint rejects Pi's default "none" for this model. + ...(api === "openai-responses" && model === "gpt-5.3-codex" ? { thinkingLevelMap: { off: "low" } } : {}), input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: positiveInteger("contextWindow", 128_000), diff --git a/skills/rig/harness-tools.md b/skills/rig/harness-tools.md index 2054b95..d14499a 100644 --- a/skills/rig/harness-tools.md +++ b/skills/rig/harness-tools.md @@ -105,6 +105,10 @@ shell, and forwards only `PATH`, `RIG_JUDGE_ENGINE=pi`, and the managed `PI_CODING_AGENT_DIR`. The judges read the generated gateway model configuration; upstream credentials remain in AWF. +For the judges' `gpt-5.3-codex` model on the Responses API, the fixture maps +Pi's default `off` thinking level to `low` because the gateway rejects `none`. +This does not change the outer Pi session or Chat Completions requests. + One invocation is enforced before asynchronous work, including failed attempts. The tool supports cancellation, a 180-second timeout, and a 1 MiB limit per output stream. It removes stale results, validates all three typed judgments, diff --git a/src/pi-gateway-workflow.test.ts b/src/pi-gateway-workflow.test.ts index 5ee2897..f1f07ad 100644 --- a/src/pi-gateway-workflow.test.ts +++ b/src/pi-gateway-workflow.test.ts @@ -31,7 +31,7 @@ afterEach(async () => { function gateway(baseUrl = "http://api-proxy:10002", api = "openai-completions", model = "gpt-5.3-codex") { return { providers: { - "aw-gateway": { baseUrl, api, apiKey: "awf-proxy", models: [{ id: model }] }, + "aw-gateway": { baseUrl, api, apiKey: "awf-proxy", models: [{ id: model, reasoning: true }] }, }, }; } @@ -80,11 +80,17 @@ it.each(["success", "bad-json", "empty-reason", "provider-error"].flatMap((scena server = createServer(async (request, response) => { const chunks: Buffer[] = []; for await (const chunk of request) chunks.push(Buffer.from(chunk)); + const body = JSON.parse(Buffer.concat(chunks).toString()); requests.push({ path: request.url ?? "", authorization: request.headers.authorization, - body: JSON.parse(Buffer.concat(chunks).toString()), + body, }); + if (api === "openai-responses" && body.reasoning?.effort === "none") { + response.writeHead(400, { "content-type": "application/json" }); + response.end(JSON.stringify({ error: { message: 'gpt-5.3-codex does not support reasoning.effort "none"' } })); + return; + } if (scenario === "provider-error") { response.writeHead(401, { "content-type": "application/json" }); response.end(JSON.stringify({ error: { message: "Gateway authentication failed" } })); @@ -146,6 +152,11 @@ it.each(["success", "bad-json", "empty-reason", "provider-error"].flatMap((scena expect(requests).toHaveLength(3); for (const [index, request] of requests.entries()) { expect(request.body["model"]).toBe("gpt-5.3-codex"); + if (api === "openai-responses") { + expect(request.body["reasoning"]).toEqual({ effort: "low" }); + } else { + expect(request.body).not.toHaveProperty("reasoning_effort"); + } expect(JSON.stringify(request.body[api === "openai-responses" ? "input" : "messages"])).toContain(["clarity", "safety", "feasibility"][index]); expect(request.authorization).toBe("Bearer awf-proxy"); expect(request.path).toBe(api === "openai-responses" ? "/responses" : "/chat/completions");