You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pre-warmed worktree pool for instant thread creation #192
A pre-warmed worktree pool: a reserve worktree is claimed and renamed on task creation, skipping the 3-7s worktree add (docs).
Solenta today
setupWorktree (electron/worktrees.js:524-525) creates the worktree synchronously on demand, every time.
Why it matters
On large repos, worktree creation (plus setup scripts and .env copying once those land) is the dead time between "I have an idea" and "agent is running." A background pool makes new threads feel instant in the "fire off five threads" workflow Solenta targets.
Fix direction
Keep N idle worktrees per project, refreshed in the background; claim + rename on thread creation, with the sync path as fallback when the pool is empty.
Research note (Jules Environment Snapshots, Codex/Claude setup caches, Conductor per-workspace run environments): besides pre-warmed worktrees, cache the environment setup per repo (deps installed, build warmed) so a new thread skips install entirely. Jules exposes this as a named feature ('Run and Snapshot'); a broken snapshot must never go live (fall back to last good, per Cursor Builds).
Research note (Vercel Drives / Northflank): decouple caches from worktree lifecycle. A per-project shared cache volume (node_modules, build caches) mounted into every worktree run and surviving worktree deletion is the big real-world speedup; pairs with the env snapshot idea above.
Research note: Cursor shipped Builds (Aug 13) — exactly this pattern: pre-warmed environment copies prepared in the background, 3x faster time-to-first-token, and crucially 'a broken build never becomes active; agents keep using the last successful build'. Build history tab shows which build each agent run used. The last-good-fallback and per-run build attribution are now table stakes for env snapshots.
They continuously prepare a ready environment (deps installed, install script already run) and boot agents from it. Internally they claim 10x faster env boot and 3x faster time-to-first-token. The important part is not the speed:
When a bad commit or dependency update breaks your environment, agents keep using the last successful build. The broken build never becomes active.
A local worktree pool that only does claim+rename (#192 as written) still starts agents in a red setup the moment main goes bad. The local analog is: keep N ready worktrees and refuse to promote a setup that failed its own probe (install script, typecheck, whatever #153/#282 define). Agents keep the last green snapshot; the user gets a notification; we do not silently hand them a broken tree.
Also pairs with #396 (honor the repo env spec) — the install command is what the Build runs.
Round 19 intel: Cursor Cloud Agents Builds (changelog 2026-08-13) is the mature version of environment pre-warming, with two ideas beyond a warm pool:
Resilient pinning: a new build that fails never becomes active. Agents keep booting from the last successful build and the user is notified of the breakage in the background. A bad commit or dep update can no longer break every new session.
Build provenance: a Builds tab shows status, logs, commit SHAs, and which build each agent run used. When a run misbehaves, you can tell whether the environment changed under it.
For Solenta's worktree pool: warm worktrees should record their provenance (base SHA, setup-script run, timestamp) on the thread, and a failed setup script on a warm worktree should poison that worktree, not the pool. Related: #153, #396, and #511 (no silent fallback).
2026-10-01 local measurement: git worktree add --detach /private/tmp/solenta-worktree-perf-4bbd0820 HEAD on the Solenta checkout took 0.20 s wall time; removal took 0.11 s. captureLeadSnapshot took 13.5 ms median over 15 runs. The live app has 0/12 projects with setupCommand configured. A pool of bare worktrees would therefore save little in this workload while adding persistent disk use and refresh/cleanup state. Keep this idea for a repo where measured checkout/setup dominates time to first token; benchmark dependency setup separately before pursuing environment snapshots.
Additional live disk measurement (2026-10-01): across 21 current worktree directories, 14 real node_modules directories use 5.3 GiB; four other dependency directories are symlinks. This supports the earlier comments that dependency reuse could save more disk/setup than prewarming a bare Git checkout. It is an aggregate read-only measurement; no dependency cache design or time-to-first-token improvement was tested.
Activity
currentbits commentedon Aug 17, 2026
Research note (Jules Environment Snapshots, Codex/Claude setup caches, Conductor per-workspace run environments): besides pre-warmed worktrees, cache the environment setup per repo (deps installed, build warmed) so a new thread skips install entirely. Jules exposes this as a named feature ('Run and Snapshot'); a broken snapshot must never go live (fall back to last good, per Cursor Builds).
currentbits commentedon Aug 17, 2026
Research note (Vercel Drives / Northflank): decouple caches from worktree lifecycle. A per-project shared cache volume (node_modules, build caches) mounted into every worktree run and surviving worktree deletion is the big real-world speedup; pairs with the env snapshot idea above.
currentbits commentedon Aug 18, 2026
Research note: Cursor shipped Builds (Aug 13) — exactly this pattern: pre-warmed environment copies prepared in the background, 3x faster time-to-first-token, and crucially 'a broken build never becomes active; agents keep using the last successful build'. Build history tab shows which build each agent run used. The last-good-fallback and per-run build attribution are now table stakes for env snapshots.
currentbits commentedon Aug 18, 2026
Round-19: Cursor Builds (13 Aug, https://cursor.com/changelog/08-13-26) is the cloud version of this issue, with one extra rule we should steal.
They continuously prepare a ready environment (deps installed, install script already run) and boot agents from it. Internally they claim 10x faster env boot and 3x faster time-to-first-token. The important part is not the speed:
A local worktree pool that only does claim+rename (#192 as written) still starts agents in a red setup the moment
maingoes bad. The local analog is: keep N ready worktrees and refuse to promote a setup that failed its own probe (install script, typecheck, whatever #153/#282 define). Agents keep the last green snapshot; the user gets a notification; we do not silently hand them a broken tree.Also pairs with #396 (honor the repo env spec) — the install command is what the Build runs.
currentbits commentedon Aug 18, 2026
Round 19 intel: Cursor Cloud Agents Builds (changelog 2026-08-13) is the mature version of environment pre-warming, with two ideas beyond a warm pool:
For Solenta's worktree pool: warm worktrees should record their provenance (base SHA, setup-script run, timestamp) on the thread, and a failed setup script on a warm worktree should poison that worktree, not the pool. Related: #153, #396, and #511 (no silent fallback).
currentbits commentedon Oct 1, 2026
2026-10-01 local measurement:
git worktree add --detach /private/tmp/solenta-worktree-perf-4bbd0820 HEADon the Solenta checkout took 0.20 s wall time; removal took 0.11 s.captureLeadSnapshottook 13.5 ms median over 15 runs. The live app has 0/12 projects withsetupCommandconfigured. A pool of bare worktrees would therefore save little in this workload while adding persistent disk use and refresh/cleanup state. Keep this idea for a repo where measured checkout/setup dominates time to first token; benchmark dependency setup separately before pursuing environment snapshots.currentbits commentedon Oct 1, 2026
Additional live disk measurement (2026-10-01): across 21 current worktree directories, 14 real
node_modulesdirectories use 5.3 GiB; four other dependency directories are symlinks. This supports the earlier comments that dependency reuse could save more disk/setup than prewarming a bare Git checkout. It is an aggregate read-only measurement; no dependency cache design or time-to-first-token improvement was tested.Pre-warmed worktree pool for instant thread creation (#192)
Pre-warmed worktree pool for instant thread creation (#192) (#1564)
Pre-warmed worktree pool for instant thread creation (#192)