Skip to content

feat(cli): allow interactive scan budget increases - #724

Merged
mldangelo-oai merged 4 commits into
mainfrom
mdangelo/codex/interactive-scan-budget
Sep 1, 2026
Merged

feat(cli): allow interactive scan budget increases#724
mldangelo-oai merged 4 commits into
mainfrom
mdangelo/codex/interactive-scan-budget

Conversation

@mldangelo-oai

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

Copy link
Copy Markdown
Collaborator

Summary

Interactive scans currently stop when their estimated cost exceeds --max-cost, even when the user would approve more spending. This change offers a higher total limit at 80% of the current budget, while the scan is still running. The original limit remains active until the increase is saved, and continuing preserves the scan ID, completed work, and accumulated cost.

The change also fixes accounting needed for reliable budget decisions: a parent receipt can be lost when only worker logs are available, and a cost-limit error can omit usage recorded while the scan is stopping.

Changes

  • Reuse the dashboard input loop to accept a higher total USD limit. Blank Enter or Escape keeps the old limit; Ctrl-C or Ctrl-D cancels. CI, JSON/JSONL, headless, verbose, and non-TTY scans keep their existing budget behavior.
  • Add the optional SDK onBudgetApproaching({ maxCostUsd, cost, signal }) callback and report the effective limit through onCost(cost, maxCostUsd). Decisions do not block tracking; invalid, failed, or late increases leave the old limit enforced.
  • Persist approved increases in the existing scan recipe without replacing other settings. Reuse the same scan, output, and cumulative usage; time and discovery limits do not change.
  • Reconcile parent and validation receipts with cumulative session logs once per thread, preserve unknown usage, and include later measured spending in cost-limit errors.
  • Update help and documentation. No new public CLI flag or dependency is introduced.
  • Set up Python 3.12 before Windows test shards and preserve the runner's temporary directories in workflow-resume fixtures. Apply the Python formatting checks added on main.

Testing

Current main integration:

  • API, cost, dashboard, CLI, custom-validation, and release-workflow tests: 707 passed, 2 platform skips.
  • Python workbench tests: 108 passed.
  • Types and generated-model checks, formatting, bundled-plugin source checks, Ruff lint/format checks, portable Python source checks, and git diff --check: passed.
  • The full local seed-12345 run encountered exhausted temporary storage and is not counted as a pass. Full-suite and installed-package verification are pending on the new-head CI run.
  • No live model calls or package publication were performed.

Risk and rollout

The existing --max-cost option now offers increases only in the interactive scan dashboard. SDK callers opt in through the new callback; callers without it retain automatic stopping. Only finite totals above the current limit and latest estimate are accepted, and cancellation takes precedence over a late answer.

This does not pause model work or resume a scan after exhaustion. The old limit can still stop the scan while the user decides, and sampled estimates can overshoot the cap. Post-scan prompts remain outside scan cost tracking, as documented. Bulk and component budget interactions are unchanged. No database migration is needed.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T20:20:44.345173Z 36e31c2 Manual request
🔒 Security Review Completed 2026-08-31T20:19:51.437880Z 36e31c2 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review commit 1dfb35e546f96842d2673db0a8638102320fd3a2.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 1dfb35e546

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

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review commit e99ea0e4d96bda40c7157c6a6ec3161167911d2e.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: e99ea0e4d9

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

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current head 36e31c2f92490c72ab03f29fbbb8411f32f77dab after the main integration, especially the Windows test setup and preservation of interactive budget behavior.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 36e31c2f92

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

@mldangelo-oai
mldangelo-oai merged commit c075b8a into main Sep 1, 2026
44 of 72 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/interactive-scan-budget branch September 1, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants