fix(desktop): Cache Runtime locally on WSL Filesystem, dramatically improving launch times - #5769
Conversation
|
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:
Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This is a large, cross-cutting change to packaged WSL startup and Windows release artifacts, introducing local runtime extraction, integrity checks, fallback ordering, cache invalidation, pruning, and filesystem cleanup. Because the new path is automatically selected and has significant runtime and persistent side effects, its blast radius requires human review despite the extensive test coverage. You can add or adjust custom eligibility rules. Learn more. |
|
One idea: key the cache on a hash of the archive instead of |
|
This is actually a better solution than the one that I'm proposing on #4825 because it's actually fixing the issue rather than just increasing the wait time. Happy to close my PR and support this one instead. |
moinmir
left a comment
There was a problem hiding this comment.
I was working on a similar PR and saw this created. The solution looks correct. I ran an AI review comparing this PR to my solution and found some issues that I'm posting here. I don't understand the code 100% but these seem reasonable. Feel free to disregard if they are not useful.
|
Asked my agent to implement some of the changes suggested by @moinmir, all seems to work well, waiting on other pending checks on github but I guess I can get to those tomorrow, if the PR agents have any more suggestions... looks like there are a bunch of other WSL PR's as well so idk who's will get merged, after this I gotta see if there's anything I can do about install speed because it takes forever |
There was a problem hiding this comment.
re-reviewed exact updated head cb5d9dd15d2a382d03698e79ee7ef0fc16bf1451.
changes requested: cross-release content-only cache naming is implemented, but two cache-identity/recovery gaps remain. details inline.
verified fixed: the cache key is now sha256-<contentId> with no app version or architecture prefix; equivalent trees with different mtimes keep one id; changed file bytes change the id; archive bytes and the embedded content-id manifest are checked; the new extra resource is excluded from app.asar; reinstalls preserve in-use runtimes. all earlier tar, docs, node-pty recovery, archive-integrity, and prune-lease fixes remain present.
local verification: exact head passes 154/154 focused tests and 798/798 broader desktop/scripts tests. desktop/scripts typechecks, formatting, and diff checks pass. lint exits successfully with one unused-variable warning in DesktopBackendConfiguration.test.ts:1079.
current-main integration: cleanly mergeable with current origin/main (e67074f80933a27bd3cdc4e24f486358407690fb); synthetic merge passes 157/157 focused and 802/802 broader tests, typechecks, formatting, and diff checks.
ci: normal CI/web/mobile workflows are still action_required with zero jobs because this is an unvouched fork. code review, CI, and actual merge readiness remain separate.
release readiness: I did not run a Windows packaged WSL end-to-end launch, so this review does not establish Windows + WSL release readiness.
…/t3code into fix-wsl-local-runtime
…al shell The install script's mutual exclusion and its two identity gates were only covered by assertions on the generated text, which pass whether or not the script does what it says. Execute them instead: two concurrent installs extract once and agree on the cache root, a mid-stream extraction failure leaves no directory behind, and an archive that disagrees with either its recorded digest or its content id is refused without filling the cache. Also orders the test's imports alphabetically, as the rest of the list is. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
re-reviewed exact updated head 1814e23fcefb740eeb7a65de72699c528a126773.
code review: approved. both prior blockers are fixed. warm-cache reuse now verifies bin.mjs against the digest recorded at install, and the former zero-byte-entry reproduction now fails over when the archive is unavailable or repairs from it when available. the content id now includes semantic executable bits, entry types, root-directory modes, and symlink targets while remaining insensitive to ownership and mtimes. real-shell regressions exercise warm reuse, corruption repair/fallback, concurrent installation, failed extraction cleanup, archive-digest refusal, and content-id refusal. no new code findings.
local verification: exact head passes 170/170 focused tests and 815/815 broader desktop/scripts tests. desktop/scripts typechecks, formatting, and diff checks pass. lint exits successfully with one unused-variable warning in DesktopBackendConfiguration.test.ts:1079.
current-main integration: cleanly mergeable with current origin/main (a3a8cbd60539b4af4de8f96c892dbd07a2b6c041); synthetic merge passes the same 170/170 focused and 815/815 broader tests, typechecks, formatting, and diff checks.
ci: normal CI, web/mobile previews, fingerprint, and desktop macOS preview remain action_required with zero jobs because this is an unvouched fork. code approval is separate from actual merge readiness.
release readiness: I did not run a Windows packaged WSL end-to-end launch, so this review does not establish Windows + WSL release readiness.
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cee8a4a. Configure here.
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
## What's Changed * fix(grok): improve skills, plans, usage, and turn reliability by @t3dotgg in pingdotgg/t3code#8358 * fix(server): recover stale Codex approval callbacks by @luckyPipewrench in pingdotgg/t3code#5195 * test(server): remove duplicate missing worktree test by @t3-code[bot] in pingdotgg/t3code#8252 * fix(server): replay all un-applied events during projection bootstrap by @krutftw in pingdotgg/t3code#7538 * test: remove low-signal test files by @t3-code[bot] in pingdotgg/t3code#8397 * test: prune trivial error and layout tests by @t3-code[bot] in pingdotgg/t3code#8400 * Fix Android adaptive launcher icon by @colonelpanic8 in pingdotgg/t3code#4332 * feat(web): split provider settings into list and editor by @t3dotgg in pingdotgg/t3code#8380 * fix(codex): accept Codex 0.150 account plans by @gsimone in pingdotgg/t3code#8447 * fix(tooling): allow ignored-only staged changes by @juliusmarminge in pingdotgg/t3code#8468 * fix(mobile): keep iOS home header stable by @juliusmarminge in pingdotgg/t3code#8467 * fix(web): stop showing red x summaries for ordinary tool failures by @t3dotgg in pingdotgg/t3code#8395 * fix(mobile): refine Git action toast glass styling by @juliusmarminge in pingdotgg/t3code#8399 * fix(desktop): allow preview automation in agent-created threads by @t3dotgg in pingdotgg/t3code#8483 * test(web): remove redundant cache key test by @t3-code[bot] in pingdotgg/t3code#8484 * fix(release): move nightly schedule to minute 38 by @t3dotgg in pingdotgg/t3code#8509 * fix(web): stabilize the provider settings editor by @t3dotgg in pingdotgg/t3code#8472 * fix(web): open GitHub pull requests in browser when loading fails by @t3dotgg in pingdotgg/t3code#8507 * fix(codex): show sub-agent models by @t3dotgg in pingdotgg/t3code#8502 * feat(analytics): report connected client platforms by @t3dotgg in pingdotgg/t3code#8481 * feat(server): accept PDF, ZIP, and other file uploads up to 50MB by @t3dotgg in pingdotgg/t3code#8235 * feat(web): toggle a thread's pin from the keyboard by @ipanasenko in pingdotgg/t3code#8440 * fix(web): add back button to project settings by @StiensWout in pingdotgg/t3code#8168 * refactor(mobile): compile semantic themes for Uniwind by @juliusmarminge in pingdotgg/t3code#7327 * fix(desktop): Cache Runtime locally on WSL Filesystem, dramatically improving launch times by @ikifar2012 in pingdotgg/t3code#5769 * fix(mobile): show OpenCode model sources in picker by @juliusmarminge in pingdotgg/t3code#8573 * fix(clients): honor project default models in new threads by @anirudhsama in pingdotgg/t3code#6011 * fix(mobile): show file actions on Android by @none23 in pingdotgg/t3code#8215 * fix(connect): explain DPoP connection failures by @extoci in pingdotgg/t3code#8351 * feat(web): make the sidebar project filter a searchable combobox by @SunkenInTime in pingdotgg/t3code#5931 * fix(server): a draft can retry its first send after a failed bootstrap by @shivamhwp in pingdotgg/t3code#8226 * fix(desktop): stop hidden previews draining battery by @Bil0000 in pingdotgg/t3code#8567 * fix(desktop): oauth popups open from the browser preview by @walid-baharwal in pingdotgg/t3code#8435 * fix(web): keep long task drawers usable on small screens by @shivamhwp in pingdotgg/t3code#8313 * fix(opencode): handle child approvals, stops, and model catalogs by @t3dotgg in pingdotgg/t3code#8480 * fix: make thread auto-settling opt-in by @shivamhwp in pingdotgg/t3code#8321 * fix(web): stop session activity timing test from blocking releases by @t3dotgg in pingdotgg/t3code#8585 * fix(mobile): show composer menus when starting a task by @juliusmarminge in pingdotgg/t3code#8587 * fix(web): show the configured stash shortcut by @UtkarshUsername in pingdotgg/t3code#8437 * feat(web): add toggleable confirmation before unpinning a thread by @UtkarshUsername in pingdotgg/t3code#7313 * fix: restore automatic thread settling defaults by @t3dotgg in pingdotgg/t3code#8596 * fix(mobile): restore composer glass and rounded shadows by @juliusmarminge in pingdotgg/t3code#8597 ## New Contributors * @luckyPipewrench made their first contribution in pingdotgg/t3code#5195 * @krutftw made their first contribution in pingdotgg/t3code#7538 * @colonelpanic8 made their first contribution in pingdotgg/t3code#4332 * @ikifar2012 made their first contribution in pingdotgg/t3code#5769 * @walid-baharwal made their first contribution in pingdotgg/t3code#8435 **Full Changelog**: pingdotgg/t3code@v0.0.35...v0.0.36 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.36
* fix(grok): improve skills, plans, usage, and turn reliability (pingdotgg#8358) Co-authored-by: Dara Adedeji <daraadedeji07@gmail.com> Co-authored-by: Ahmed Besic <ahmed-besic@users.noreply.github.com> Co-authored-by: Michael Brown <michaeltbrown.mtb@gmail.com> Co-authored-by: Lars Nieuwenhuis <35393046+lnieuwenhuis@users.noreply.github.com> Co-authored-by: Guilherme Barros <gbarros1095@gmail.com> Co-authored-by: PC <pc@localhost> Co-authored-by: 1xpixi <157762409+1xpixi@users.noreply.github.com> * fix(server): recover stale Codex approval callbacks (pingdotgg#5195) * test(server): remove duplicate missing worktree test (pingdotgg#8252) Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> * fix(server): replay all un-applied events during projection bootstrap (pingdotgg#7538) Co-authored-by: Theo Browne <me@t3.gg> * test: remove low-signal test files (pingdotgg#8397) Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> * test: prune trivial error and layout tests (pingdotgg#8400) Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> * Fix Android adaptive launcher icon (pingdotgg#4332) Co-authored-by: Yash Singh <saiansh2525@gmail.com> * feat(web): split provider settings into list and editor (pingdotgg#8380) * fix(codex): accept Codex 0.150 account plans (pingdotgg#8447) * fix(tooling): allow ignored-only staged changes (pingdotgg#8468) * fix(mobile): keep iOS home header stable (pingdotgg#8467) Co-authored-by: Julius Marminge <julius@mac.lan> * fix(web): stop showing red x summaries for ordinary tool failures (pingdotgg#8395) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * fix(mobile): refine Git action toast glass styling (pingdotgg#8399) * fix(desktop): allow preview automation in agent-created threads (pingdotgg#8483) * test(web): remove redundant cache key test (pingdotgg#8484) Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> * fix(release): move nightly schedule to minute 38 Recent scheduled nightlies have been delayed or skipped. Move the nightly cron from minute 7 to minute 38. Keep the existing three-hour interval. This tests a different point in each three-hour window without claiming it will fix GitHub schedule delivery. Authored by GPT-5.6 Sol with the Codex harness. * fix(web): stabilize the provider settings editor (pingdotgg#8472) * fix(web): open GitHub pull requests in browser when loading fails (pingdotgg#8507) * fix(codex): show sub-agent models (pingdotgg#8502) * feat(analytics): report connected client platforms (pingdotgg#8481) * feat(server): accept PDF, ZIP, and other file uploads up to 50MB (pingdotgg#8235) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * feat(web): toggle thread pin from the keyboard Add a mod+shift+p shortcut that pins or unpins the active thread. Ignore the shortcut during terminal focus and when the server does not support thread pinning. * fix(web): add back button to project settings (pingdotgg#8168) * refactor(mobile): compile semantic themes for Uniwind (pingdotgg#7327) Co-authored-by: codex <codex@users.noreply.github.com> * fix(desktop): Cache Runtime locally on WSL Filesystem, dramatically improving launch times (pingdotgg#5769) Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com> * fix(mobile): show OpenCode model sources in picker (pingdotgg#8573) Co-authored-by: Julius Marminge <julius@mac.lan> * fix(clients): honor project default models in new threads (pingdotgg#6011) Co-authored-by: Shivam Sharma <91240327+shivamhwp@users.noreply.github.com> * fix(mobile): show file actions on Android (pingdotgg#8215) Co-authored-by: Shivam Sharma <91240327+shivamhwp@users.noreply.github.com> * fix(connect): explain DPoP connection failures (pingdotgg#8351) Co-authored-by: Julius Marminge <julius0216@outlook.com> * feat(web): make the sidebar project filter a searchable combobox (pingdotgg#5931) * fix(server): a draft can retry its first send after a failed bootstrap (pingdotgg#8226) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * fix(desktop): stop hidden previews draining battery (pingdotgg#8567) * fix(desktop): oauth popups open from the browser preview (pingdotgg#8435) Co-authored-by: Julius Marminge <julius0216@outlook.com> * fix(web): keep long task drawers usable on small screens (pingdotgg#8313) * fix(opencode): handle child approvals, stops, and model catalogs (pingdotgg#8480) * fix: make thread auto-settling opt-in (pingdotgg#8321) * fix(web): stop session activity timing test from blocking releases (pingdotgg#8585) * fix(mobile): show composer menus when starting a task (pingdotgg#8587) Co-authored-by: Julius Marminge <julius@mac.lan> * fix(web): show the configured stash shortcut (pingdotgg#8437) Co-authored-by: Shivam Sharma <91240327+shivamhwp@users.noreply.github.com> * feat(web): add toggleable confirmation before unpinning a thread (pingdotgg#7313) Co-authored-by: Shivam Sharma <91240327+shivamhwp@users.noreply.github.com> * fix: restore automatic thread settling defaults (pingdotgg#8596) * fix(mobile): restore composer glass and rounded shadows (pingdotgg#8597) Co-authored-by: Julius Marminge <julius@mac.lan> * Remove Messages Glass Lab experiment (pingdotgg#8599) * chore(release): prepare v0.0.36 --------- Co-authored-by: Theo Browne <me@t3.gg> Co-authored-by: Dara Adedeji <daraadedeji07@gmail.com> Co-authored-by: Ahmed Besic <ahmed-besic@users.noreply.github.com> Co-authored-by: Michael Brown <michaeltbrown.mtb@gmail.com> Co-authored-by: Lars Nieuwenhuis <35393046+lnieuwenhuis@users.noreply.github.com> Co-authored-by: Guilherme Barros <gbarros1095@gmail.com> Co-authored-by: PC <pc@localhost> Co-authored-by: 1xpixi <157762409+1xpixi@users.noreply.github.com> Co-authored-by: Josh <gitlucky@pipelab.org> Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: Tradi3 <56069280+krutftw@users.noreply.github.com> Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Ivan Malison <IvanMalison@gmail.com> Co-authored-by: Yash Singh <saiansh2525@gmail.com> Co-authored-by: Gianmarco <gianmarcosimone89@gmail.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Julius Marminge <julius@mac.lan> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Illia Panasenko <hello@ipanasenko.me> Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com> Co-authored-by: codex <codex@users.noreply.github.com> Co-authored-by: Matheson Steplock <ikifar2012@users.noreply.github.com> Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com> Co-authored-by: Anirudh Coontoor <anirudh@gosupernova.live> Co-authored-by: Shivam Sharma <91240327+shivamhwp@users.noreply.github.com> Co-authored-by: Nick Anisimov <n.anisimov.23@gmail.com> Co-authored-by: Exotic <118054752+extoci@users.noreply.github.com> Co-authored-by: Dara Adedeji <76637177+SunkenInTime@users.noreply.github.com> Co-authored-by: Bilal Bakr <62337003+Bil0000@users.noreply.github.com> Co-authored-by: Muhammad Waleed <114993336+walid-baharwal@users.noreply.github.com>

What Changed
~/.t3/wsl-runtimeserver.asartree as a fallbackWhy
Launching the backend from WSL's Linux filesystem avoids repeated
/mnt/creads. The cache now has a desktop-owned directory and one verified archive identity, while the build omits Windows/Darwin native payloads and pnpm install metadata that WSL cannot use.Verification
T3CodeWSLFixGitHub.mp4
Note
Medium Risk
Reworks packaged Windows WSL backend startup, cache identity, and fallback ordering; mis-handled transient vs fatal preflight outcomes could affect launch reliability despite extensive tests.
Overview
Packaged Windows builds now ship
wsl-runtime.tar.gzplus a SHA-256 sidecar (when a Linux node-pty prebuild is bundled). WSL resolution prefers installing that archive into~/.t3/wsl-runtime/sha256-<digest>via newDesktopWslEnvironmentAPIs (prepareRuntime,invalidateRuntime,pruneRuntimes) and generated install/prune shell scripts (locking, digest checks, readiness markers, in-use detection).runWslPreflightno longer always materializesserver.asarup front: it stages and probes the cached runtime first, runs legacy Windows extraction cleanup on success, and falls back to the mounted/mntserver tree when staging fails or a fatal staged node-pty probe fails (invalidating the bad cache when the fallback works).DesktopBackendManagerrecordswslRuntimeIdon the start config and prunes older caches after HTTP readiness.The desktop artifact builder stages the Linux-only archive (excludes Windows/Darwin natives and pnpm metadata), validates archive/hash/members in packaged payloads, and docs describe the new WSL install behavior. Tests cover configuration fallbacks, manager pruning, server-tree cleanup, script generation, and executed POSIX install races.
Reviewed by Cursor Bugbot for commit cee8a4a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Cache WSL runtime on WSL filesystem to improve desktop launch times
wsl-runtime.tar.gz+.sha256sidecar) as a Windows extraResource; build-desktop-artifact.ts stages, hashes, and validates it during the Windows buildrunWslPreflightin DesktopBackendConfiguration.ts now stages the packaged archive into a distro-local cache viaDesktopWslEnvironment.prepareRuntime, probes it, and falls back to the mounted server tree only when staging fails fatallyprepareRuntime,pruneRuntimes, andinvalidateRuntime; the install script uses POSIXflock, SHA-256 digest verification, atomic promotion, and in-use safety; the prune script retains the current and one previous cachemakeBackendInstancein DesktopBackendManager.ts callspruneRuntimesto remove older caches;cleanupLegacyin DesktopWslServerTree.ts removes the old Windows extraction cache once the staged runtime is healthyensureNodePtynow expects alinuxAppRootpath instead of converting a Windows path internally; any caller still passingwindowsRepoRootwill break. WSL launches that previously always used the mounted tree now depend on a staged cache and may fall back if the archive is missing or corruptMacroscope summarized dc98770.
request provenance