Skip to content

[codex] suppress low usage remaining warnings when credits are available - #28593

Merged
dhruvgupta-oai merged 5 commits into
mainfrom
codex/suppress-usage-warnings-with-credits
Jun 24, 2026
Merged

[codex] suppress low usage remaining warnings when credits are available#28593
dhruvgupta-oai merged 5 commits into
mainfrom
codex/suppress-usage-warnings-with-credits

Conversation

@brooks-oai

@brooks-oai brooks-oai commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Why

The TUI computed proactive Heads up, you have less than ... warnings before considering workspace credits. As a result, users could see included-limit warnings even when they could continue using Codex with workspace credits.

has_credits alone is not sufficient to determine whether finite credits are usable: a spend-control hard limit can cap the reported balance to zero while has_credits still reflects the workspace's raw balance. Unlimited credits are the opposite case: they are usable even though no numeric balance is reported.

What changed

  • suppress proactive TUI rate-limit usage warnings and the lower-cost model nudge when usable workspace credits are available
  • treat credits as usable when has_credits is true and either unlimited is true or the parsed balance is positive
  • continue showing warnings when the usable balance is zero, including when a spend-control limit has capped otherwise available workspace credits
  • add regression coverage for zero-balance, positive-balance, and unlimited workspace-credit snapshots

Validation

  • just test -p codex-tui rate_limit_usage_warnings_

@brooks-oai
brooks-oai force-pushed the codex/suppress-usage-warnings-with-credits branch from 83bfda7 to 77d916c Compare June 16, 2026 21:50
@brooks-oai
brooks-oai marked this pull request as ready for review June 16, 2026 21:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

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: 77d916c344

ℹ️ 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 codex-rs/tui/src/chatwidget/rate_limits.rs Outdated
@brooks-oai brooks-oai changed the title [codex] suppress usage warnings with credits [codex] suppress low usage remaining warnings when credits are available Jun 24, 2026
@dhruvgupta-oai
dhruvgupta-oai enabled auto-merge (squash) June 24, 2026 18:24
@dhruvgupta-oai
dhruvgupta-oai merged commit 5013d10 into main Jun 24, 2026
59 of 63 checks passed
@dhruvgupta-oai
dhruvgupta-oai deleted the codex/suppress-usage-warnings-with-credits branch June 24, 2026 18:43
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants