Repository navigation
perf(desktop): unblock Windows startup and shrink the installer - #5122
simon-curtis wants to merge 18 commits into
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:
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 |
There was a problem hiding this comment.
One Effect convention issue found in the changed service code (apps/server/src/terminal/Manager.ts). Everything else in the diff (namespace imports, dependency acquisition via yield* ServerSettings.ServerSettingsService, capability-source construction) looks consistent with the conventions.
Posted via Macroscope — Effect Service Conventions
|
Fixes #4533 |
There was a problem hiding this comment.
One finding: the new command-resolution cache is process-global mutable state rather than an environment value. See the inline comment.
Posted via Macroscope — Effect Service Conventions
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing terminal shell setting, changes Windows startup behavior from blocking to async profile loading, adds provider environment refresh infrastructure across all drivers, and includes Windows installer customizations. These are significant new capabilities and runtime behavior changes warranting human review. You can customize Macroscope's approvability policy. Learn more. |
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 1f7ea81. Configure here.

Problem
On Windows, the installed desktop app could spend nearly a minute with no window while synchronous command discovery and provider initialization blocked backend readiness. Upgrade installation was similarly opaque and slow because oversized packages contained thousands of unpacked files that the previous uninstaller and antivirus scanned individually.
Windows users also could not choose the executable used for new T3 terminal sessions.
How this fixes it
Windows performance results
The original comparison used installed production builds on the same Windows host. Startup was measured from process spawn to the first completed HTTP 200 and to the first visible Electron window.
Performance test head (
e4a322213) was rebuilt as a production Windows package and rerun from its staged executable with isolatedAPPDATA, isolatedT3CODE_HOME, and a dedicated port. The staged package was used to avoid overwriting the developer's installed app.The latest-head median is 1.6% faster to HTTP readiness and 0.9% faster to a visible window than the original new-release median. Run 2 is retained as a host-level outlier rather than discarded; temporary unpacked builds showed intermittent Windows scanning/contention, while the other two runs and the median remained in the original range. Individual Windows command-resolution spans remained bounded rather than reproducing the previous synchronous startup stall.
All measurements require HTTP 200 rather than treating an open TCP socket as ready. Each run was fully stopped before the next launch and used isolated state rather than the live user database.
Packaging and installation results
Upgrade timings are observational rather than a controlled benchmark: the old measurement removed the original 2,494-file Nightly, while the final measurement replaced an already-compacted build.
User-visible behavior
Verification
mainat2a04db134c2d88f06e5b8d61a8410cb51ea07430.git diff --checkpassed.Checklist
Model: GPT-5 / GPT-5.4
Harness: OpenAI Codex desktop app with dev-loop specialist review
Note
Medium Risk
Touches Windows PATH timing at startup, provider registry reconciliation, and live environment refresh for all drivers; incorrect hydration or refresh ordering could leave tools undiscovered until profile load completes or briefly stale maintenance metadata.
Overview
This PR targets Windows startup and upgrades by stopping synchronous PowerShell profile work from blocking server readiness, tightening command/PATH resolution, and refreshing provider state in place after the profile finishes loading.
Startup and environment: The server applies a baseline Windows PATH immediately and forks PowerShell profile hydration (
PATH, FNM vars) in the background. The desktop app no longer spawns PowerShell to buildPATHat launch. SharedresolveCommandPathgains caching, PATH/PATHEXT precedence, concurrent probing, and safer invalidation when directories are unreadable.Providers: Instance env is built from
makeProviderInstanceEnvironmentSourcewithrefreshEnvironmentso host PATH changes merge without recreating adapters. Maintenance capabilities are lazy/cached and refresh after hydration. After Windows profile hydration completes, the registry refreshes snapshots in place (no reconcile/replace). Reconcile is serialized and interrupt-safe with staged entries during rebuilds. Settings watcher re-reads settings and can restore redacted secrets when secret-store reads fail.Terminals and settings: New
defaultTerminalShellsetting (General settings, contracts, docs) drives spawn behavior; Windows resolves configured names through PATH, treats the value as an executable only (no embedded args), and subscribes to live settings updates.Installer / docs: NSIS hooks show explicit “Removing the previous version…” / install phase text. README links terminal shell user docs.
Reviewed by Cursor Bugbot for commit b990f52. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Improve Windows environment hydration, command-path resolution, and terminal shell configuration
hostEnvironmentHydrationLayerin os-jank.ts, unblocking startup.defaultTerminalShellsetting toServerSettingsand the General settings panel; on Windows the configured shell name is resolved against PATH/PATHEXT before spawning.refreshEnvironmenteffect that re-syncs inherited host env values and invalidates maintenance capability caches without replacing the instance.ProviderInstanceRegistry.reconcileis now serialized, interruption-safe, and supports a{ force: true }option; previous snapshots remain visible during rebuild.installWindowsEnvironmenton Desktop; PATH enrichment from the PowerShell profile happens asynchronously and may arrive after the first terminal is opened.Macroscope summarized b990f52.