feat(M1): Codex Reliability Fix
This commit is contained in:
@@ -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[] = [];
|
||||
|
||||
Reference in New Issue
Block a user