Skip to content

[codex] Add quota spend forecasting#145

Draft
xodapi wants to merge 1 commit into
graykode:mainfrom
xodapi:codex/quota-spend-forecast
Draft

[codex] Add quota spend forecasting#145
xodapi wants to merge 1 commit into
graykode:mainfrom
xodapi:codex/quota-spend-forecast

Conversation

@xodapi

@xodapi xodapi commented Jun 21, 2026

Copy link
Copy Markdown

Summary

  • add quota burn-rate tracking for account-level rate limits
  • expose burn rate and ETA fields in JSON snapshots
  • show quota detail strings that warn when the account would hit the cap before reset
  • ignore empty Codex rate_limits events so the UI does not render null pseudo-limits
  • focus the quota panel on active agents, so Codex-only workspaces do not spend space on an empty Claude column
  • clarify unknown quota states and add active/total/average token stats in the selected-session detail footer
  • add --status-json, a compact privacy-preserving status payload for widgets/mobile clients

Why

Codex can report account quota windows in token_count events, but users need more than the current remaining percentage. A small burn-rate estimate makes it easier to see whether the current pace is safe or likely to hit the cap before the window resets.

The UI also benefits from treating Codex-only workspaces as a first-class case: when only Codex is active, the quota panel should prioritize Codex state and avoid showing an empty Claude half-column.

For lower-risk integrations such as mobile widgets, --status-json emits only aggregate health/quota fields and omits local paths, prompts, chat text, session identifiers, tool arguments, child commands, and project names.

Validation

  • cargo check
  • cargo test rate_limit_spend
  • cargo test quota_
  • cargo test status_summary
  • cargo test readme_documents_json_snapshot_privacy_surface
  • cargo test test_parse_codex
  • cargo test codex_non_1m_context_window_does_not_show_1m_suffix
  • cargo run -- --demo --status-json

Note: a full cargo test run on this Windows checkout still has unrelated existing collector test failures around temp/process/file ownership behavior; the new quota, UI, status summary, and Codex parser tests pass.

@xodapi xodapi force-pushed the codex/quota-spend-forecast branch from a2b46ef to da6bbe1 Compare June 21, 2026 08:54
@xodapi xodapi force-pushed the codex/quota-spend-forecast branch from da6bbe1 to 0024e5b Compare June 21, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant