Skip to content

Read Codex limits without waiting on account/read - #13733

Merged
dhh merged 1 commit into
quattrofrom
codex-limits-account-read
Sep 29, 2026
Merged

dhh merged 1 commit into
quattrofrom
codex-limits-account-read

Conversation

@dhh

@dhh dhh commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

The agents panel often showed "Codex limits unavailable" with nothing but account/read as the explanation.

The Codex collector asks codex app-server for account/read (only to learn the plan name) and then account/rateLimits/read. With Codex 0.158, account/read frequently never answers. Timed directly, it had no reply after 30 seconds in three runs out of three, while account/rateLimits/read answered in about 0.5 seconds. Because account/read came first with a 4-second timeout, the whole limits read failed whenever it hung, which happened two times out of three on my machine.

The rate limits already carry planType, so the collector now asks for them first and uses that. account/read is only a short fallback when the plan is missing, and a timeout there no longer loses the limits.

Tests

  • test/shell.d/agent-usage-codex-scanner-test.sh: a stand-in app-server that never answers account/read still yields the plan and limits, in well under the old timeout.
  • Five runs against a real Codex Pro login all succeed in under a second, reporting the weekly limit.

🤖 Generated with Claude Code

Codex 0.158's app-server can leave account/read unanswered, and asking it
first lost the limits whenever it did, leaving the agents panel showing
"Codex limits unavailable". The limits name the plan themselves, so they're
asked first and account/read is only a short fallback when they don't.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dhh
dhh merged commit b421b1b into quattro Sep 29, 2026
@dhh
dhh deleted the codex-limits-account-read branch September 29, 2026 10:20
tossbaws added a commit to tossbaws/omarchy that referenced this pull request Sep 30, 2026
Resolve the test conflict with omacom#13733 by keeping both tests. The batched
reply test now follows the limits-first order: the notification shares a
write with the account/rateLimits/read reply, and a trailing notification
after the initialize reply carries into the next request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dhh added a commit that referenced this pull request Oct 1, 2026
#13733 landed the Codex limits change this branch also carried. The
branch's version keeps its additions on top: reset credits and reading a
signed-out home as a sign-in to restore.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
omarchybot added a commit to betizzel/omarchy that referenced this pull request Oct 1, 2026
quattro now asks for account/rateLimits/read before account/read and treats an account/read that never answers as harmless (omacom#13733), so the stalled-app-server test stalls on the limits read, which is the call a hung server now fails on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
buger added a commit to probelabs/omarchy that referenced this pull request Oct 1, 2026
Upstream omacom/omarchy quattro moved e332dc9 -> c05d901 (omacom#13733 Codex
limits, omacom#13771 aether nvim path, omacom#13770 agent accounts). None of the four
commits touches the menu or lock components this proof layer covers.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
sgruendel pushed a commit to sgruendel/omarchy that referenced this pull request Oct 3, 2026
Codex 0.158's app-server can leave account/read unanswered, and asking it
first lost the limits whenever it did, leaving the agents panel showing
"Codex limits unavailable". The limits name the plan themselves, so they're
asked first and account/read is only a short fallback when they don't.

Co-authored-by: Claude Opus 5.5 <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
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.

2 participants