Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): WSL backend connects with Docker bridges and slow cold starts #6129

Closedrehanhaider(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/6129/headopened View on GitHub

Showing 2 changed files with 13 additions and 6 deletions.

x
0 of 2 viewed, 2 left
2 additions and 1 deletionapps/desktop/src/backend/DesktopBackendManager.tsModified
View file
@@ -60,7 +60,8 @@
// failures may instead provide their own larger retryLimit when they should
// self-heal for a while but must not leave the app connecting forever.
const MAX_PREFLIGHT_FAILURE_ATTEMPTS = 5;
-const DEFAULT_BACKEND_READINESS_TIMEOUT = Duration.minutes(1);
+// One-shot probe; a WSL backend over /mnt/c regularly needs 60-98s to answer.
+const DEFAULT_BACKEND_READINESS_TIMEOUT = Duration.minutes(3);
Thread on line 64

P1 Badge Add a focused test for the extended readiness budget

The intended slow-cold-start behavior is not covered by the existing readiness test, which supplies its own 50 ms timeout and therefore cannot detect this default being reverted or wired to the wrong backend path. Add a TestClock manager test where readiness succeeds after more than one minute but before three minutes and assert that onReady fires; otherwise this backend behavior change can regress while the focused desktop suite remains green.

AGENTS.md reference: AGENTS.md:L108-L108

Useful? React with 👍 / 👎.

const DEFAULT_BACKEND_READINESS_INTERVAL = Duration.millis(100);
const DEFAULT_BACKEND_READINESS_REQUEST_TIMEOUT = Duration.seconds(1);
const DEFAULT_BACKEND_TERMINATE_GRACE = Duration.seconds(2);
11 additions and 5 deletionsapps/desktop/src/wsl/DesktopWslEnvironment.tsModified
View file
@@ -688,13 +688,19 @@
Effect.scoped(
Effect.gen(function* () {
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
- // `hostname -I` prints a space-separated list of all non-loopback
- // IPs the distro has bound. The first entry on the WSL2 default
- // network is always the eth0 vEthernet address Windows can reach
- // directly (no wslhost forwarding required).
const command = ChildProcess.make(
"wsl.exe",
- [...buildDistroArgs(distro), "--", "sh", "-c", "hostname -I"],
+ // `hostname -I` orders by interface, so a Docker bridge can mask the
+ // eth0 address NAT mode needs and the host address mirrored mode maps
+ // to loopback. The default route's source is printed first and wins;
+ // the `hostname -I` tail is the fallback without iproute2.