Skip to content

fix(codex): format status rate limits like usage#81149

Merged
obviyus merged 3 commits into
openclaw:mainfrom
MatthewSchleder:fix/codex-status-rate-limit-wording-fresh
May 14, 2026
Merged

fix(codex): format status rate limits like usage#81149
obviyus merged 3 commits into
openclaw:mainfrom
MatthewSchleder:fix/codex-status-rate-limit-wording-fresh

Conversation

@MatthewSchleder

Copy link
Copy Markdown
Contributor

Summary

  • Aligns /codex status rate-limit output with the main /status usage style.
  • Shows remaining quota instead of used quota, e.g. primary 74% left.
  • Replaces raw ISO reset timestamps in status summaries with compact reset durations, e.g. ⏱3h or ⏱7d.
  • Keeps the newer current-main /codex account availability and paused-limit summaries intact.
  • Adds a changelog entry for the user-facing /codex status output change.

Real behavior proof

  • Behavior addressed: /codex status rate-limit summaries now show remaining quota and compact reset durations instead of used quota and raw ISO timestamps.
  • Real environment tested: Local OpenClaw checkout on the rebased PR branch, running the real Codex status formatter through Node/tsx against an app-server-shaped status payload.
  • Exact steps or command run after the patch: 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\"}]}}}));"
  • Evidence after fix: Terminal output from the formatter command:
Codex app-server: connected
Models: gpt-5.5
Account: codex@example.com
Rate limits: Codex: primary 74% left ⏱3h · secondary 96% left ⏱7d
MCP servers: 1
Skills: 1
  • Observed result after fix: The status line reports primary 74% left ⏱3h · secondary 96% left ⏱7d, matching the intended remaining-quota and compact-reset wording.
  • What was not tested: Full live /codex status chat round trip was not run locally; GitHub workflows will validate the rebased branch.

Verification

  • git diff --check
  • node_modules/.bin/oxfmt --check --threads=1 extensions/codex/src/app-server/rate-limits.ts extensions/codex/src/commands.test.ts CHANGELOG.md
  • Formatter proof command above

Notes

  • Not run locally: Vitest. GitHub workflows will validate the rebased branch.

@openclaw-barnacle openclaw-barnacle Bot added extensions: codex size: XS proof: supplied External PR includes structured after-fix real behavior proof. labels May 12, 2026
@clawsweeper

clawsweeper Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR updates the Codex plugin rate-limit formatter, one command test expectation, and the changelog so /codex status reports remaining quota and compact reset durations.

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 X% left output. I did not run local tests because this was a read-only review, but the source path and CI evidence are clear.

Real behavior proof
Sufficient (terminal): The PR body includes after-fix terminal output from running the changed formatCodexStatus formatter through Node/tsx against an app-server-shaped payload, directly showing the new status line.

Next step before merge
No repair lane is needed; this is a focused external PR with no blocking findings and green relevant checks, so the next action is ordinary maintainer review and merge consideration.

Security
Cleared: Cleared: the diff is limited to a TypeScript formatter, one command test expectation, and changelog text, with no workflow, dependency, script, secret, or package-resolution changes.

Review details

Best 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 X% left output. I did not run local tests because this was a read-only review, but the source path and CI evidence are clear.

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:

  • Current main behavior: Current main still formats Codex status rate-limit windows as used percent and appends verbose reset text with formatResetTime, so the requested behavior is not already implemented on main. (extensions/codex/src/app-server/rate-limits.ts:333, dbf5b213af67)
  • Shared usage formatter target: The shared provider usage formatter computes remaining quota, prints <label> <remaining>% left, joins multiple windows with ·, and appends compact reset suffixes. (src/infra/provider-usage.format.ts:61, dbf5b213af67)
  • Documented status usage wording: The status docs say --usage prints normalized provider usage windows as X% left, supporting the PR's stated alignment target. Public docs: docs/cli/status.md. (docs/cli/status.md:23, dbf5b213af67)
  • PR diff surface: The live PR diff changes the Codex-owned rate-limit summary to show remaining quota, compact reset durations, middle-dot window separators, the focused command expectation, and a changelog entry. (extensions/codex/src/app-server/rate-limits.ts:332, 557d52ddc4e1)
  • Proof and checks: The PR body includes after-fix terminal output from formatCodexStatus showing primary 74% left ⏱3h · secondary 96% left ⏱7d, and the live check-runs API showed relevant build/check/lint/type/security lanes completed successfully for the head SHA. (c9e900a9b1da)
  • Related PR context: The earlier same-change PR was closed unmerged by the contributor with a comment saying this replacement keeps the same formatter change, proof, and verification.

Likely related people:

  • steipete: Recent GitHub path history shows steipete on Codex command/test maintenance and shared provider usage formatter work that defines the target style. (role: recent area contributor / adjacent formatter owner; confidence: high; commits: 6ee0c9a69654, 7d9232a9a93a, 14b4c7fd56ae; files: extensions/codex/src/app-server/rate-limits.ts, extensions/codex/src/commands.test.ts, src/infra/provider-usage.format.ts)
  • pashpashpash: Recent path history shows pashpashpash authored nearby Codex rate-limit reset and account summary behavior used by this formatter. (role: Codex rate-limit feature contributor; confidence: medium; commits: b2c3202a15e7, c3af812fe3de, 30ed0329cbc3; files: extensions/codex/src/app-server/rate-limits.ts, extensions/codex/src/commands.test.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 1b645b21fc0c.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 12, 2026
@obviyus obviyus force-pushed the fix/codex-status-rate-limit-wording-fresh branch from 4f7e55b to 9cb1dba Compare May 14, 2026 10:06
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 14, 2026
@obviyus obviyus merged commit d25bece into openclaw:main May 14, 2026
108 checks passed
@obviyus

obviyus commented May 14, 2026

Copy link
Copy Markdown
Contributor

Landed via rebase onto main.

  • Scoped tests: git diff --check; node_modules/.bin/oxfmt --check --threads=1 extensions/codex/src/app-server/rate-limits.ts extensions/codex/src/app-server/rate-limits.test.ts extensions/codex/src/commands.test.ts CHANGELOG.md; pnpm test extensions/codex/src/app-server/rate-limits.test.ts extensions/codex/src/commands.test.ts
  • Changelog: CHANGELOG.md updated
  • Land commit: 9cb1dba
  • Merge commit: d25bece

Thanks @MatthewSchleder!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex proof: supplied External PR includes structured after-fix real behavior proof. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants