Question
Every warm launch pays for machinery it never uses: _get_clone_manager() runs at dl.py:2313, before the get_workspace_state fast-attach check at dl.py:2338 — reading config.toml, reading metadata.json twice (storage.py:90 and :106 via exclusive()), taking the shared metadata.json.lock flock, mkdir'ing repos_dir, and running migrate_cache — and then the warm path attaches without ever touching the clone manager. Defer its construction until a code path actually needs it, so a warm dl <ws> -- <cmd> does no metadata I/O and takes no metadata lock.
Notes:
- Failing test first: on a warm launch (workspace state
Running), no open/read of metadata.json and no acquisition of metadata.json.lock (mock at the storage/locks seam, or extend the spawn-count-style pinning approach).
- The cold path must construct it exactly as today — existing tests stay green; the spawn-count sequences in test/test_devpod_spawn_counts.py must not change.
- Watch call-order assumptions:
parse_owner_repo_branch/default-branch resolution at dl.py:2319 uses the clone manager when the spec has no @branch — a bare-spec warm launch may still need it; only the paths that don't must skip it. Laziness (construct on first use) is likely simpler than reordering.
- CI green (
pixi run ci, check py310).
Question
Every warm launch pays for machinery it never uses:
_get_clone_manager()runs at dl.py:2313, before theget_workspace_statefast-attach check at dl.py:2338 — readingconfig.toml, readingmetadata.jsontwice (storage.py:90 and :106 viaexclusive()), taking the sharedmetadata.json.lockflock, mkdir'ingrepos_dir, and runningmigrate_cache— and then the warm path attaches without ever touching the clone manager. Defer its construction until a code path actually needs it, so a warmdl <ws> -- <cmd>does no metadata I/O and takes no metadata lock.Notes:
Running), no open/read ofmetadata.jsonand no acquisition ofmetadata.json.lock(mock at the storage/locks seam, or extend the spawn-count-style pinning approach).parse_owner_repo_branch/default-branch resolution at dl.py:2319 uses the clone manager when the spec has no@branch— a bare-spec warm launch may still need it; only the paths that don't must skip it. Laziness (construct on first use) is likely simpler than reordering.pixi run ci, check py310).