Skip to content

fix: make verbose scan reruns and cost failures actionable - #253

Merged
mldangelo-oai merged 4 commits into
mainfrom
mdangelo/codex/fix-verbose-scan-diagnostics
Aug 4, 2026
Merged

fix: make verbose scan reruns and cost failures actionable#253
mldangelo-oai merged 4 commits into
mainfrom
mdangelo/codex/fix-verbose-scan-diagnostics

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Support --verbose for saved scan reruns without changing authentication selection.
  • Include configured scan budgets in verbose configuration diagnostics.
  • Classify exceeded budgets correctly and report both observed and maximum cost.
  • Reuse existing rerun, authentication, and budget tests instead of duplicating fixtures.
  • Preserve existing credential and provider-identifier logging behavior.

Validation

  • Full Bun test suite: 773 passed, 5 expected platform/integration skips, 0 failed across 34 files.
  • Focused CLI, authentication, and workbench suites: 142 passed.
  • All 19 built-CLI smoke scenarios passed, including JSON/JSONL reruns, environment precedence, profiles, and budget failures.
  • Fresh npm installation validated the CLI, public import, 95 bundled plugin files, and all 179 package entries.
  • node --run build, node --run lint, node --run format, and node --run generate:models:check all passed.

Copy link
Copy Markdown
Collaborator Author

@codex review exact head 9d7434a

Please review saved-scan verbose flag handling, preservation of existing authentication selection, and cost-limit diagnostics.

@github-actions github-actions Bot added the bug Something isn't working label Aug 4, 2026
@mldangelo-oai
mldangelo-oai marked this pull request as ready for review August 4, 2026 00:25
@mldangelo-oai
mldangelo-oai requested a review from Copilot August 4, 2026 00:25

Copy link
Copy Markdown
Collaborator Author

@codex review exact head 9d7434a

Please review the ready-for-review PR, focusing on saved-scan verbose behavior, unchanged authentication selection, and budget-limit diagnostics.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --verbose support to scans rerun, including schema exposure and forwarding into the scan runner.
  • Includes max_cost_usd in verbose scan.configuration diagnostics.
  • Correctly classifies ScanCostLimitExceededError as cost_limit_exceeded and logs both max_cost_usd and estimated_usd in 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 9d7434ab64

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 9d7434ab64

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai
mldangelo-oai requested a review from Copilot August 4, 2026 00:31

Copy link
Copy Markdown
Collaborator Author

@codex review exact head 92f2b9d

Please review the simplified rerun implementation, consolidated JSON/JSONL authentication coverage, and cost-limit diagnostics.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 92f2b9d836

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --verbose uses the same redaction/sanitization as other verbose scan diagnostics, but the option description currently implies raw diagnostics. Align the wording with the scan command to avoid suggesting unredacted output.
        verbose: z
          .boolean()
          .default(false)
          .describe("Print scan diagnostics to stderr."),
      }),

sdk/typescript/src/cli.ts:2977

  • partial_output in the scan.failed diagnostic is derived only from the local scanDir variable. If a ScanInterruptedError (including ScanCostLimitExceededError) is thrown with a scanDir before onOutputDirReady runs, the message will correctly mention partial output, but the diagnostic will incorrectly report partial_output=false.
            : classifyConnectionFailure(failure),
      partial_output: scanDir !== null,
      max_cost_usd: costLimitFailure?.maxCostUsd,
      estimated_usd: costLimitFailure?.cost.estimatedUsd,

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 92f2b9d836

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai
mldangelo-oai requested a review from Copilot August 4, 2026 00:35

Copy link
Copy Markdown
Collaborator Author

@codex review exact head fa26b7d

Please review the code-only verbose rerun and budget-diagnostic changes; the README is unchanged.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: fa26b7d572

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: fa26b7d572

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai
mldangelo-oai merged commit 50e2ad0 into main Aug 4, 2026
16 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/fix-verbose-scan-diagnostics branch August 4, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants