Add Enterprise monthly credit limit to /statusline

Open 💬 2 comments Opened Jun 26, 2026 by ksiom

What variant of Codex are you using?

CLI

What feature would you like to see?

I’d like /statusline to support showing the Enterprise monthly credit limit, similar to the existing 5h and weekly limit items.

Current behavior:

  • /status can show Enterprise monthly credit limit data.
  • /statusline can show short limit summaries for other limits.
  • There is no dedicated /statusline item for the Enterprise monthly credit limit.

Requested behavior:

  • Add a new /statusline item named monthly-limit.
  • Display it in the same short style as other limit items, for example:
  • monthly 68% left
  • Refresh the value as other limit items.

This would make Enterprise monthly usage visible in the footer without having to manually run /status.

Additional information

_No response_

View original on GitHub ↗

2 Comments

Nicolas0315 · 2 months ago

I put together a focused patch for this here:

https://github.com/openai/codex/compare/main...Nicolas0315:codex/statusline-monthly-limit?expand=1

What it does:

  • adds a selectable /statusline item with id monthly-limit
  • renders monthly N% left from the existing Enterprise spend-control individual_limit snapshot when available
  • falls back to the monthly rolling rate-limit window if the individual monthly spend-control snapshot is not present
  • wires the item through picker metadata, preview rows, style accenting, and status surface rendering
  • adds focused tests for selection and rendered/preview output

Verification:

  • rtx4090 local Windows: just fmt, git diff --check, cargo test --manifest-path codex-rs\Cargo.toml -p codex-tui monthly_limit -- --nocapture, cargo test --manifest-path codex-rs\Cargo.toml -p codex-tui status_surface_preview -- --nocapture, cargo test --manifest-path codex-rs\Cargo.toml -p codex-tui status_line_setup -- --nocapture, cargo check --manifest-path codex-rs\Cargo.toml -p codex-tui
  • SSH cyberagent-mac-m5max: fetched 655274f13, git diff --check origin/main...HEAD, monthly-limit focused tests, status-surface preview tests, cargo check --manifest-path codex-rs/Cargo.toml -p codex-tui
  • SSH nicolas2025: fetched 655274f13, git diff --check origin/main...HEAD, cargo check --manifest-path codex-rs\Cargo.toml -p codex-tui
  • SSH nicolas-macbook-pro: fetched 655274f13, git diff --check origin/main...HEAD; Rust toolchain unavailable on this host, so cargo checks were skipped there
  • SSH rtx5060ti: fetched 655274f13, git diff --check origin/main...HEAD; cargo check is blocked by this host's linker setup (link.exe rejects MSVC linker flags, cargo exit 101), and I confirmed no lingering cargo/rustc/link processes remained
  • latest origin/main (812cd2bb5) merge-tree check: no conflicts
Mong-Gu · 25 days ago

I’m seeing the same need in a managed ChatGPT Enterprise workspace.

In this workspace, /status exposes the monthly allowance through individualLimit, but /statusline has no corresponding item. I traced the existing TUI data flow and verified a small local, TUI-only prototype that:

  • adds a dedicated monthly-credit-limit statusline item;
  • renders individualLimit.remaining_percent as monthly N% left;
  • omits only that segment when individualLimit is unavailable; and
  • keeps it independent from the existing five-hour and weekly items, so they can coexist.

Small follow-up: I’ve published the tested proof of concept here:

The patch is based on the current upstream main and keeps the monthly workspace spend-control value independent from rolling rate-limit windows.

Local verification:

  • just test -p codex-tui: 3,358 passed, 4 skipped
  • cargo build -p codex-cli
  • just fix -p codex-tui
  • just fmt
  • no pending snapshots

One naming consideration: I would prefer monthly-credit-limit over the more generic monthly-limit. This value comes from optional workspace spend-control data, rather than a monthly rolling rate-limit window. I also think the picker item should remain selectable even when the value is unavailable; conditionally omitting the rendered segment keeps the configuration stable across account or workspace changes.

I have local coverage for rendering, unavailable data, boundary values, and coexistence. I understand that external code contributions are invitation-only; if this direction aligns with the intended UX, would an invited PR be welcome?

<img width="1247" height="452" alt="Image" src="https://github.com/user-attachments/assets/f0c8502f-935d-4c54-adc4-50a13a91f773" />