Skip to content

fix(launcher): tolerate slow cold first start (Windows)#305

Merged
lstein merged 2 commits into
masterfrom
lstein/fix/launcher-startup-timeout
Jun 7, 2026
Merged

fix(launcher): tolerate slow cold first start (Windows)#305
lstein merged 2 commits into
masterfrom
lstein/fix/launcher-startup-timeout

Conversation

@lstein
Copy link
Copy Markdown
Owner

@lstein lstein commented Jun 7, 2026

Problem

On a clean Windows machine, first launch timed out and the browser never opened. The server does start, but the first import torch is slow — Windows Defender scans the ~80 freshly-written package DLLs on first access, which routinely exceeds the launcher's old 60-second readiness wait. Subsequent launches are fast.

Fix

  • Poll for server readiness up to 5 minutes instead of 60s. There's no penalty on the normal path: the browser opens the instant the port is reachable (typically seconds), well before the cap; the cap only bounds the "open it manually" fallback message.
  • Abort the wait immediately if the server process exits (via a done channel), so a genuine crash no longer makes the user wait out the full timeout before seeing the error.

Tests

New browser_test.go: verifies it bails promptly on server exit and detects a reachable port quickly. gofmt/vet/-race clean.

🤖 Generated with Claude Code

lstein and others added 2 commits June 7, 2026 11:36
First launch on Windows can exceed the old 60s readiness wait because Windows Defender scans the freshly written torch DLLs on first import, so the browser never opened. Poll up to 5 minutes (it opens the instant the port is reachable, so no penalty on the normal path), and abort immediately via a done channel if the server process exits, so a crash no longer waits out the timeout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lstein lstein merged commit 15add88 into master Jun 7, 2026
9 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