Repository navigation
fix(server): keep Claude reset times on quick retries - #18616
realhasanshoaib wants to merge 4 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused Claude adapter bug fix that preserves existing rate-limit reset metadata across quick retries and adds targeted regression coverage. Runtime changes are isolated to failure bookkeeping and recovery timing, with no schema, default, security, billing, infrastructure, or static-analysis configuration impact. Notes:
You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7ba802d2b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Dismissing prior approval to re-evaluate c7ba802
Dismissing prior approval to re-evaluate d10d0e2
Problem
A quick retry after a Claude usage limit can lose its reset time. The latest failure then says “Reset time unavailable; retry manually,” stops snoozing, and never auto-resumes—even though Claude sent the reset with that same failure.
The CLI throttles unchanged
rate_limit_eventframes. It still includes the rejected window in the root assistant'sapi_error_params.rate_limit_info, which T3 did not read.Change
Read that structured payload on root assistant rate-limit errors. Keep event-provided timestamps when both sources name the same window, and keep all other rejected windows when choosing the final reset. Invalid timestamps, overage, and nested subagent errors cannot supply a root reset. Embedded metadata belongs only to the latest root response, so an internal retry cannot carry a stale limit into a later provider error. No cross-turn cache, text parsing, settings, or client changes.
Completeness: 5/5 for this fix. Web, desktop, and mobile consume the same persisted failure and server recovery path.
Scope and approval
Fixes #15665. Live trace and reproduction. This is a focused adapter bug fix that restores existing recovery behavior; it does not change defaults or add a feature. It uses the embedded-payload direction from @EhsanulHaqueSiam's reproduction on that issue. #15697 addresses the report with a broader cross-turn cache; this PR handles the observed follow-up path without that state.
Verification
Continue where you left off.and completes. No real credentials or subscription quota used.Before is left; after is right. Synthetic project and messages only.
auto-resume.mp4
The 32-second recording shows a rapid follow-up failure, snoozing, and automatic recovery through the real browser (captured at 1 fps).
Test cleanup
Removed 18 of 20 added cases (90%), including timestamp/schema examples, repeated embedded/event combinations and extra retry-matrix scenarios. Restored the pre-existing retry matrix rather than rewriting it. Two added runtime cases remain: embedded-only wake continuation and choosing the later rejected window. They catch deliberate mutations that drop the embedded reset or select the earlier window. Typechecking and schemas cover structure; they do not replace those runtime checks. No production code, dependencies or runner configuration changed.
Focused tests, server typecheck, lint and formatting pass on the M4 mini. A separate Codex review of the test-only deletion slice found no actionable regression.
GPT-6.1 Sol, high reasoning, Codex harness in T3 Code.