fix(desktop): increase backend readiness timeout to 3 minutes - #4825
fix(desktop): increase backend readiness timeout to 3 minutes#4825carlospedreira wants to merge 3 commits into
Conversation
WSL backend startup can exceed the one-minute readiness deadline when the packaged server bundle is loaded through /mnt/c, leaving the app stuck on "Connecting to WSL..." even though the backend eventually becomes healthy. Raise the default readiness timeout to 3 minutes; polling still resolves immediately once the endpoint responds, so fast backends are unaffected. Fixes pingdotgg#4535 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: Approved 5405ecd Simple timeout constant increase from 1 to 3 minutes to accommodate slower WSL backends. No behavioral change for fast backends since polling resolves immediately when ready. You can customize Macroscope's approvability policy. Learn more. |
Summary
Increases
DEFAULT_BACKEND_READINESS_TIMEOUTinapps/desktop/src/backend/DesktopBackendManager.tsfrom 1 minute to 3 minutes.Fixes #4535
Why
When the packaged server bundle is loaded through
/mnt/c, WSL backend startup can take well over the current 60-second readiness window (~117 seconds measured on my system — see this comment). The backend eventually becomes healthy, but the desktop app has already stopped probing and stays stuck on "Connecting to WSL…" forever.This only raises the maximum wait: readiness polling still resolves as soon as the endpoint responds, so fast backends connect immediately as before. Precedent: #1979 previously raised this timeout from 10s to 30s, and other remote backend paths already use three-minute startup/readiness windows.
Note this is a pragmatic mitigation — it does not address the underlying
/mnt/cfilesystem performance problem for the WSL bundle.Verification
pnpm typecheck(apps/desktop) passes.pnpm test src/backend/DesktopBackendManager.test.ts— 12 tests pass.🤖 Generated with Claude Code
Note
Low Risk
Single constant and comment change in desktop backend lifecycle timing; no auth, data, or API surface changes.
Overview
Raises
DEFAULT_BACKEND_READINESS_TIMEOUTinDesktopBackendManagerfrom 1 minute to 3 minutes so WSL backends that load the packaged server from/mnt/ccan finish startup before readiness polling stops (fixes stuck “Connecting to WSL…” when startup exceeds ~60s).Polling still completes as soon as
/.well-known/t3/environmentresponds; this only extends the maximum wait. A short comment documents the WSL/mnt/cmotivation (#4535).Reviewed by Cursor Bugbot for commit f876714. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Increase backend readiness timeout from 1 minute to 3 minutes in
DesktopBackendManagerUpdates
DEFAULT_BACKEND_READINESS_TIMEOUTin DesktopBackendManager.ts to accommodate slower WSL backends that need more time to become ready before the timeout triggers.Macroscope summarized f876714.