Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

fix(cli): use the singular for one review round in Deep Scan stop reasons (#2443)

Lanre Shittua8e7c717d7a5
diff --git a/sdk/typescript/src/cli.ts b/sdk/typescript/src/cli.ts
index f6919a98e..7c48a4d11 100644
--- a/sdk/typescript/src/cli.ts
+++ b/sdk/typescript/src/cli.ts
@@ -11853,7 +11853,7 @@ async function readDeepScanStop(
| undefined;
if (state?.terminalReason === "saturated") {
return {
- reason: `The last ${state.noNewStreak} review rounds found no new issues. More issues may remain.`,
+ reason: `The last ${state.noNewStreak} review round${state.noNewStreak === 1 ? "" : "s"} found no new issues. More issues may remain.`,
};
}
if (state?.terminalReason !== "capped") return undefined;
@@ -11864,7 +11864,7 @@ async function readDeepScanStop(
state.dispatchedCount >= maxDiscoveryRuns
) {
return {
- reason: `Reached the limit of ${maxDiscoveryRuns} review rounds. ${state.noNewStreak === 0 ? "The latest review still found new issues." : "More issues may remain."}`,
+ reason: `Reached the limit of ${maxDiscoveryRuns} review round${maxDiscoveryRuns === 1 ? "" : "s"}. ${state.noNewStreak === 0 ? "The latest review still found new issues." : "More issues may remain."}`,
nextStep: `To scan further, rerun with --max-discovery-runs greater than ${maxDiscoveryRuns}.`,
};
}
diff --git a/sdk/typescript/tests-ts/cli-deep-scan-summary.test.ts b/sdk/typescript/tests-ts/cli-deep-scan-summary.test.ts
index 695750e17..0bc0e50b1 100644
--- a/sdk/typescript/tests-ts/cli-deep-scan-summary.test.ts
+++ b/sdk/typescript/tests-ts/cli-deep-scan-summary.test.ts
@@ -58,6 +58,16 @@ describe("deep scan completion summary", () => {
"5-minute time limit. No source review completed.",
"--max-time greater than 5",
],
+ [
+ "a one-round review limit",
+ {
+ dispatchedCount: 1,
+ completionSequence: 1,
+ config: { maxDiscoveryRuns: 1, maxTimeHours: 96 },
+ },
+ "limit of 1 review round. The latest review still found new issues",
+ "--max-discovery-runs greater than 1",
+ ],
[
"quiet round",
{ noNewStreak: 1 },
@@ -70,6 +80,12 @@ describe("deep scan completion summary", () => {
"last 4 review rounds found no new issues",
null,
],
+ [
+ "one quiet review round",
+ { terminalReason: "saturated", noNewStreak: 1 },
+ "last 1 review round found no new issues",
+ null,
+ ],
[
"time limit",
{