Repository navigation
Conversation
account/read and account/rateLimits/read usually answer in ~2s but routinely spike past the 4s deadline, which discards the entire refresh's rate-limit data even though the previous cycle was fine. 10s leaves ample margin while still bounding a hung app-server. Fixes omacom#13425
On some setups the app-server never replies to account/read at all while rateLimits/read answers every time. The single try block treated that silence as a total failure and replaced the whole refresh with 'Codex limits unavailable', dropping limits that were one reply away. Ask for rateLimits/read first and keep account/read as an optional fallback wrapped in its own try, so its silence only costs the plan-label fallback it was providing. Fixes omacom#13266
Contributor
|
Thanks! This landed as #13733: limits are read first, and account/read is only a fallback for the plan. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #13458 (same call sites); rebase trivially if that lands first.
Summary
The reporter measured
account/readnever answering within 15s on 5 of 8 fresh app-server processes whileaccount/rateLimits/readanswered every time in 0.3–0.9s (#13266). Because both calls sit in onetry, theTimeoutError("account/read")replaced the whole refresh with"Codex limits unavailable"andlimits: [], discarding data that was one reply away.account/rateLimits/read— the payload the panel actually shows — is now requested first.account/read, which only supplies a fallback plan label (planTypealready comes fromrateLimitsfirst), is now wrapped in its owntrywith a short timeout; its failure leaves the limits intact.Fixes #13266
Testing
agent-usage-codex-scanner-test.shwith a fake app-server that never answersaccount/read: the collector must still print a clean record (usageStatusTextempty) with limits present. All 23 assertions pass.python3 -m py_compilepasses.