fix(codex): format status rate limits like usage#81149
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. source-reproducible: current main formats Codex rate-limit windows as used percent with verbose reset text, while the shared status usage contract uses normalized Real behavior proof Next step before merge Security Review detailsBest possible solution: Review and merge the plugin-local formatter/test/changelog change after normal maintainer approval, leaving the shared core usage formatter untouched. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main formats Codex rate-limit windows as used percent with verbose reset text, while the shared status usage contract uses normalized Is this the best way to solve the issue? Yes: changing the Codex-owned rate-limit formatter and its focused command expectation is the narrow maintainable fix for this output mismatch. Importing the core usage formatter into the plugin would add boundary coupling for a small display-only alignment. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 1b645b21fc0c. |
4f7e55b to
9cb1dba
Compare
|
Landed via rebase onto main.
Thanks @MatthewSchleder! |
Summary
/codex statusrate-limit output with the main/statususage style.primary 74% left.⏱3hor⏱7d./codex accountavailability and paused-limit summaries intact./codex statusoutput change.Real behavior proof
/codex statusrate-limit summaries now show remaining quota and compact reset durations instead of used quota and raw ISO timestamps.node --import tsx -e "import { formatCodexStatus } from \"./extensions/codex/src/command-formatters.ts\"; const now=Math.floor(Date.now()/1000); console.log(formatCodexStatus({models:{ok:true,value:{models:[{id:\"gpt-5.5\",isDefault:true}],truncated:false}},account:{ok:true,value:{account:{email:\"codex@example.com\"}}},limits:{ok:true,value:{rateLimits:{limitId:\"codex\",limitName:\"Codex\",primary:{usedPercent:26,windowDurationMins:300,resetsAt:now+3*60*60},secondary:{usedPercent:4,windowDurationMins:7*24*60,resetsAt:now+7*24*60*60},credits:null,planType:\"pro\",rateLimitReachedType:null}}},mcps:{ok:true,value:{data:[{name:\"filesystem\"}]}},skills:{ok:true,value:{data:[{name:\"repo\"}]}}}));"primary 74% left ⏱3h · secondary 96% left ⏱7d, matching the intended remaining-quota and compact-reset wording./codex statuschat round trip was not run locally; GitHub workflows will validate the rebased branch.Verification
git diff --checknode_modules/.bin/oxfmt --check --threads=1 extensions/codex/src/app-server/rate-limits.ts extensions/codex/src/commands.test.ts CHANGELOG.mdNotes