Skip to content

fix(cli): show scan usage timestamps and account allowance - #1911

Merged
mldangelo-oai merged 3 commits into
mainfrom
mdangelo/codex/live-scan-usage
Oct 25, 2026
Merged

mldangelo-oai merged 3 commits into
mainfrom
mdangelo/codex/live-scan-usage

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

During a long scan, the elapsed clock kept moving while the dashboard displayed an unchanged cost with no measurement time. Codex could also report an account allowance before reporting any tokens, and the CLI dropped that reading. Saved scan history already records these measurements.

Fixes #29.

Changes

  • Show the UTC time of the receipt behind displayed tokens and estimated cost. Explain that in-flight work may still be missing. While a worker is unmeasured, keep the time attached to the last complete total. A newer total without a timestamp shows that its measurement time is unavailable.
  • Show the reported percentage used and observation time for each account window. ChatGPT scans say when Codex has yet to report allowance.
  • Use the existing session tracker for Standard and Deep Scan. SDK callers can subscribe through the optional onUsageObservation callback. The dashboard, text progress, and component scans use the same display formatting.
  • Keep the clock and budget prompt visible on short terminals. The full readings are available in the scrollable Details view.

Testing

  • Reproduced the stale display and missing allowance on 6696705319 with a synthetic 40-minute gap and a limit-only Codex event.
  • Ran a real Standard Scan with ChatGPT sign-in against a synthetic repository. It completed successfully. The displayed timestamps matched the original Codex receipts, and the CLI showed the unavailable state when the runtime supplied no allowance windows.
  • Ran a bounded Deep Scan with ChatGPT sign-in. The displayed time matched a discovery worker's receipt. The configured cost limit stopped the scan and its partial artifacts passed validation.
  • All 348 focused CLI, component, dashboard, cost, pricing, and direct Deep Scan tests passed on b7fc1f791deb. They cover reported account windows, partial worker totals, missing timestamps, existing dollar limits, and a 48×16 terminal with eight account windows. A separate check exercised the overview, budget prompt, and Details across 20 terminal sizes.
  • Validated the 743-entry archive and ran the installed-package smoke test. The package job and the amd64 and arm64 container jobs passed after adding the formatter to the package manifest.
  • pnpm run types, pnpm run format, and git diff --check passed. Started the full SDK suites with the default ordering and with seed 12345.

Risk and rollout

Live measurements use receipts from the scan's own sessions and workers. The observer reads the same incremental stream as cost tracking. Older runtimes can omit timestamps or account windows, and the CLI labels both cases. The existing --max-cost check continues to use the API-price estimate.

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 bug Something isn't working label Oct 24, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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-10-24T03:03:16.904070Z b7fc1f7 New commits
🔒 Security Review ✅ Completed 2026-10-24T03:04:10.715061Z b7fc1f7 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f418361ac

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

Comment thread sdk/typescript/src/scan-dashboard.ts Resolved

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding live usage freshness and account allowance reporting. Owner-level merge-safety review of 9a75738: the package allowlist omission is fixed, but the existing terminal-height finding still reproduces. An 80-column, 12-row dashboard with three allowance readings renders 14 rows. Please fit the allowance section within the viewport while reserving the footer; this still needs attention before approval.

Validation: 278 portable cost, CLI, and dashboard tests passed (seed 12345), as did SDK types, formatting, plugin/package builds, the 743-entry archive contract check, and built CLI help. Synthetic receipt checks covered worker totals, missing timestamps, and allowance-only updates. The broader focused run had 302 passes and 65 failures involving local filesystem/Git fixtures; installed-package smoke also stopped at a Git fixture. A clean full integration suite is not claimed.

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for addressing the viewport feedback. No material findings in this owner-level merge-safety review of receipt accounting, SDK/component integration, CLI rendering, and packaging. The prior overflow is resolved: compact overview readings preserve the clock and budget controls, with complete readings available in Details. Account allowance remains separate from estimated-cost enforcement. Types, formatting, builds, archive validation, and 279 cost/CLI/dashboard tests passed. Independent checks covered 50 terminal configurations and nine receipt scenarios. Three direct-engine fixtures stopped at existing filesystem-owner checks, so a complete local integration pass remains unverified.

@mldangelo-oai
mldangelo-oai merged commit 3c68266 into main Oct 25, 2026
88 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/live-scan-usage branch October 25, 2026 04:48
@github-actions github-actions Bot mentioned this pull request Oct 25, 2026
3 tasks done
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.

Show usage freshness and ChatGPT allowance limits during long-running scans

3 participants