Skip to content

Honor inactive Claude account retry deadlines - #26936

Merged
nwparker merged 4 commits into
mainfrom
nwparker/reproducible-claude-inactive-429-10-09
Oct 10, 2026
Merged

nwparker merged 4 commits into
mainfrom
nwparker/reproducible-claude-inactive-429-10-09

Conversation

@nwparker

@nwparker nwparker commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Opening the Claude account switcher should respect one account’s server-requested wait while still updating other accounts.

What Changed

Automatic inactive-account refreshes now check that account’s existing retry deadline before sending a request or showing a fetching state. Recent usage and its original timestamp stay available; healthy accounts continue updating, and the blocked account becomes eligible at the exact deadline.

Usage continues through the current profile router and shared OAuth fetcher. Manual Refresh and account-change refresh keep their existing forced-attempt behavior.

Why

The shared fetcher already returns a 429’s retry deadline, but the inactive-account loop ignored it. Reopening the switcher after its 60-second debounce could send another request during a one-hour server wait. Reusing the existing per-account cache and deadline check fixes that loop without adding another retry policy or persistent cache.

Linked Issue

Partially addresses #26588: automatic retries for inactive accounts. Keep the issue open for its broader expectations, including manual force and state after restarting.

Visual Proof

The current profile-router regression uses owned synthetic accounts, the actual service and shared fetcher, and a real local HTTP server. Replacing only the inactive-account loop with main reproduces these request counts:

Reopen 61 seconds after A receives Retry-After: 3600 A requests Healthy B requests
Before 3 3
After 2 3

At A’s exact deadline, A becomes request 3 and B becomes request 4. A’s last-good quota timestamp stays unchanged while blocked. No real account, Keychain or Anthropic endpoint was used.

The original recorded-request attachment below is from commit 27da87f; the current profile-router tests reproduce the same counts. These are tables rendered from request records, not application screenshots. No rendered retry-countdown or native WSL execution is claimed.

Original standalone before/after request evidence.

Before — original recorded service HTTP requests

Before: recorded local HTTP requests

After — original recorded service HTTP requests

After: recorded local HTTP requests

Testing

  • I manually tested these changes locally with controlled service-to-local-HTTP fixtures on macOS.
  • Automated tests added/updated.

Verified PR-head checks, pinned main b3aa719, October 10: 100 tests across eight suites pass at 1d5fe2023c95d40827a4a331867c6ea26ecfbf92, which normally merges b3aa719a57ca7f5b8fe7db38abf3e9dc4b58a4bb. Production remains the same per-account deadline filter. Added HTTP-date, independently expiring account waits and invalid-header controls; guarded fixture cleanup addresses the valid bot finding. Removing the filter produces four expected request-count failures in the same fixture. Forced refresh, healthy accounts, last-good usage, expiry, account removal and stop controls remain covered. Host/WSL metadata controls mock routing and credential observation; they do not run wsl.exe.

A separate native macOS Electron 43.7.5 probe passes seven transport checks using the production OAuth parser and proxy implementation, real Chromium net.fetch, and an allowlisted local TLS endpoint through a local CONNECT proxy. It verifies seconds/date headers, caller cancellation and the unchanged ten-second timeout, with response closure, zero windows and complete owned-process/socket cleanup. No real account/provider endpoint was contacted. This transport proof does not exercise rendered account selection or the inactive-account service filter; the service fixtures above cover that policy.

Node, CLI and web typechecks, the canonical changed-code quality gate, all seven full-file quality configurations, formatting and diff checks pass. Tests and the no-window app use ORCA_BACKGROUND_LAUNCH=1 and owned temporary data. Local macOS validation read existing locked dependencies through an isolated overlay without installation, shared rebuilding or tracked configuration changes.

Fresh Linux verification of this exact source passes all 100 tests/eight suites on Linux x64 Node 24.21.0, using installed Electron in RunAsNode mode without an app/window. Its final replay excludes the shared cache and uses a new explicit owned transform cache; the exact source passes again. Fresh Windows x64 Node 24.18.0 passes 92 of 100 tests, including all 12 deadline/loopback cases; its eight failures match the exact pinned-baseline Windows titles and error classes, with no new failure. Those are existing Windows preview policy, path and PTY/Fable expectations; no full Windows green claim is made.

The initial Windows run unexpectedly triggered a borrowed Electron dependency's installer during import, adding donor files that remain preserved. Initial native overlays also linked shared Vitest caches on both hosts. Changing the Windows Electron link to an owned copy then caused 12 fixture transport failures before HTTP arrival; the fresh capsule with a sealed Electron copy and a new explicit owned transform cache passes all 12 again. This supports a stale module-resolution cache explanation; the failed runs remain evidence and are not hidden. Final runs disable installation and leave the preserved donor cache untouched. Earlier native results apply only to original 27da87f: Linux 59 cases/six suites and Windows 58 with one unchanged baseline assertion. They are historical evidence, not the current source's native result.

Ordinary CI is green at 1d5fe2023c95d40827a4a331867c6ea26ecfbf92: 14 successful and 16 skipped contexts, with no failed or pending checks. The valid bot cleanup thread is resolved after source and primary-error preservation review.

Review

Final merge verification: #26936 is merged as a09dc9aa7143e70300b012fe92486dc7478bb4d1, with the authentic Tauri-EPO co-author footer recognized by GitHub. Before merge, the two PR regression suites and newer ZCode service controls passed 21 tests across three files on the composed main 04f8f2b5 tree 96d0cb29. Main advanced during merge only in eight separate cloud/relay files (#27048). The actual squash parent is fda01fac, tree 1c0bd72e; all 13 frozen source/test/config/build objects remain identical, so the scoped service proof transfers. Root verified all 23 artifacts and confirmed that the squash changes exactly the three reviewed PR paths. No native or transport rerun is claimed. Final exact-head CI had 14 successful/16 skipped contexts; complete bot comments and the resolved cleanup finding were checked before the ordinary squash.

Reviewed commit: 1d5fe2023c95d40827a4a331867c6ea26ecfbf92; pinned main b3aa719a57ca7f5b8fe7db38abf3e9dc4b58a4bb. Root reviewed the complete filter and adapted fixtures, the added deadline controls, the bot cleanup repair and normal main integration. The final PR changes one production filter and two regression files. The execution host owns the service and account cache; no renderer gate, new RPC, durable state or transport policy was added.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

The original fix commit retains Co-authored-by: Tauri-EPO <[email protected]> for its adapted classifier work. Its direct credential-reading implementation is superseded by the current shared fetcher. No code from #26589 was retained.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after recorded-request evidence attached and its source explained
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path impact considered
  • Full lint, typecheck, test and build pass (CI will cover remaining gates)

Retain classified OAuth rate-limit deadlines and last-good usage in each inactive account cache, then skip automatic requests until that account is eligible. Preserve healthy sibling refreshes and current forced refresh policy.

Partially addresses #26588.

Co-authored-by: Tauri-EPO <[email protected]>
@nwparker
nwparker marked this pull request as ready for review October 9, 2026 19:02
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 715c3d4a-be96-46d4-9839-7c8add5adf1e





📥 Commits

Reviewing files that changed from the base of the PR and between 1ea442e and 1d5fe20.






📒 Files selected for processing (1)
  • src/main/rate-limits/service-inactive-claude-cooldown.test.ts





Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.







📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

Open-triggered inactive-account fetches now omit Claude accounts with an active cached retry-after period. Tests cover cooldown timing, retained usage, account changes, HTTP failures, and late responses. Additional tests cover rate-limited OAuth failures across managed-usage credential sources and runtime profiles.












Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 1d5fe

Automatic refreshes of inactive Claude accounts now respect an active server-requested retry deadline, while healthy accounts keep refreshing. No merge-blocking risk was identified in the supplied changes.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: inactive Claude account retry deadlines are now respected.
Description check Passed The description is complete and focused. It includes the required change summary, rationale, linked issue, visual or behavioral proof, testing details, review notes, compatibility considerations, and …

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR









  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Keep current profile-router usage reads and the shared OAuth error metadata.
Adapt the inactive-account regression fixtures to the installed profile router; preserve each account's server retry gate and healthy sibling refreshes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1546c0db-50fb-4d34-aa63-507a543e0dbe
📥 Commits

Reviewing files that changed from the base of the PR and between 27da87f and 1ea442e.

📒 Files selected for processing (3)
  • src/main/rate-limits/claude-managed-usage-credential-source.test.ts
  • src/main/rate-limits/service-inactive-claude-cooldown.test.ts
  • src/main/rate-limits/service/service-inactive-accounts.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Keep the existing per-account deadline filter and current execution-host profile router while verifying the current main source.
Exercise numeric and HTTP-date waits through the real local HTTP service, independent account expiry and invalid headers. Guard fixture cleanup when setup fails.
@nwparker
nwparker merged commit a09dc9a into main Oct 10, 2026
30 checks passed
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.

1 participant