fix: make verbose scan reruns and cost failures actionable - #253
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the CLI’s verbose diagnostics for scan reruns and cost-limit failures so that rerun behavior and budget overruns are more actionable while preserving existing authentication-selection behavior.
Changes:
- Adds
--verbosesupport toscans rerun, including schema exposure and forwarding into the scan runner. - Includes
max_cost_usdin verbosescan.configurationdiagnostics. - Correctly classifies
ScanCostLimitExceededErrorascost_limit_exceededand logs bothmax_cost_usdandestimated_usdin verbose failure diagnostics.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sdk/typescript/tests-ts/cli.test.ts | Adds regression coverage for rerun schema/options, verbose reruns/auth selection, cost-limit configuration logging, and cost-limit failure diagnostics. |
| sdk/typescript/src/cli.ts | Implements scans rerun --verbose, adds max-cost to configuration diagnostics, and enriches/classifies cost-limit failures. |
| sdk/typescript/README.md | Documents scans rerun SCAN_ID --verbose and clarifies what verbose reruns provide. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (2)
sdk/typescript/src/cli.ts:886
scans rerun --verboseuses the same redaction/sanitization as other verbose scan diagnostics, but the option description currently implies raw diagnostics. Align the wording with thescancommand to avoid suggesting unredacted output.
verbose: z
.boolean()
.default(false)
.describe("Print scan diagnostics to stderr."),
}),
sdk/typescript/src/cli.ts:2977
partial_outputin thescan.faileddiagnostic is derived only from the localscanDirvariable. If aScanInterruptedError(includingScanCostLimitExceededError) is thrown with ascanDirbeforeonOutputDirReadyruns, the message will correctly mention partial output, but the diagnostic will incorrectly reportpartial_output=false.
: classifyConnectionFailure(failure),
partial_output: scanDir !== null,
max_cost_usd: costLimitFailure?.maxCostUsd,
estimated_usd: costLimitFailure?.cost.estimatedUsd,
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
--verbosefor saved scan reruns without changing authentication selection.Validation
node --run build,node --run lint,node --run format, andnode --run generate:models:checkall passed.