Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/fixtures/pi-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 4 additions & 0 deletions skills/rig/harness-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
15 changes: 13 additions & 2 deletions src/pi-gateway-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }] },
},
};
}
Expand Down Expand Up @@ -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" } }));
Expand Down Expand Up @@ -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");
Expand Down
Loading