feat(M1): Codex Reliability Fix

This commit is contained in:
2026-05-19 19:54:27 -05:00
parent 5b78889b09
commit bcddb42608
4 changed files with 52 additions and 23 deletions
+45
View File
@@ -452,6 +452,51 @@ describe("main", () => {
}
});
it("run ignores non-numeric --timeout and falls back to config timeout", async () => {
const out = captureOutput();
try {
let receivedTimeout: number | undefined;
const code = await main(
["node", "cli.ts", "run", "--client", "codex", "--prompt", "hello", "--timeout", "not-a-number"],
{
detectClients: () => mockClients,
executePrompt: async (_client, _prompt, options?) => {
receivedTimeout = options?.timeoutMs;
return mockResult;
},
resolveConfig: () => ({ paths: {}, timeout: 600_000 }),
}
);
assert.strictEqual(code, 0);
assert.strictEqual(receivedTimeout, 600_000);
} finally {
out.restore();
}
});
it("dispatch ignores non-numeric --timeout and falls back to config timeout", async () => {
const out = captureOutput();
try {
let receivedTimeout: number | undefined;
const code = await main(
["node", "cli.ts", "dispatch", "do something", "--timeout", "bad"],
{
detectClients: () => mockClients,
executePrompt: async (_client, _prompt, options?) => {
receivedTimeout = options?.timeoutMs;
return mockResult;
},
resolveClient: () => "codex",
resolveConfig: () => ({ paths: {}, timeout: 600_000 }),
}
);
assert.strictEqual(code, 0);
assert.strictEqual(receivedTimeout, 600_000);
} finally {
out.restore();
}
});
it("dispatch prints debug diagnostic JSON to stderr with --debug", async () => {
const out = captureOutput();
const stderrChunks: string[] = [];