fix(codex): format status rate limits like usage#77815
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. source-reproducible: current main still formats Codex rate-limit windows as used percent with verbose reset text, while the existing status/usage contract uses normalized Real behavior proof Next step before merge Security Review detailsBest possible solution: Review and merge the plugin-local formatter change after relevant CI completes, keeping the output logic inside the Codex plugin and preserving the focused command expectation. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main still formats Codex rate-limit windows as used percent with verbose reset text, while the existing status/usage contract uses normalized Is this the best way to solve the issue? Yes: changing the Codex-owned rate-limit formatter and its command expectation is the narrow maintainable fix for this output-only mismatch. A core usage formatter import would cross plugin boundaries and is not needed for this small alignment. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 730cbb356feb. |
1a118f7 to
3c9e1f5
Compare
b0a849c to
a2c521a
Compare
8748a42 to
e57c22b
Compare
e57c22b to
c9e900a
Compare
|
Closing this superseded PR in favor of the fresh replacement: #81149 The replacement keeps the same formatter change, summary, proof, and verification, but is back at the top of the PR queue. |
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