Question
The git-lfs probe runs unconditionally on every workspace-clone preparation: _lfs_tracked_files (worktree/workspace_clone.py:114-131) does shutil.which("git-lfs") plus a git lfs ls-files --name-only subprocess, then _has_lfs_pointers opens the first 23 bytes of every tracked file — even for the overwhelmingly common repo with no LFS at all. Gate it so a non-LFS repo pays (at most) one cheap local check instead of a git lfs fork.
Shape of the fix (refine test-first): before forking git lfs, check whether the clone can possibly use LFS — e.g. .gitattributes (tracked or top-level) mentioning filter=lfs — and skip the whole probe when it can't. The existing deliberate choice at workspace_clone.py:350-352 (do NOT gate on is_new_workspace, so a previously failed pull isn't permanent) must be preserved: the gate must be a property of the repo content, not of launch history.
Done when:
- A failing test first: repo without LFS attributes → no
git lfs subprocess is spawned (extend the spawn-count seam or mock at the subprocess boundary).
- A repo WITH
filter=lfs attributes still probes and materializes exactly as today (existing tests stay green).
- Cold-path only — no behavior change on warm launches (there is none today; keep it that way).
- CI green (
pixi run ci, check py310).
Question
The git-lfs probe runs unconditionally on every workspace-clone preparation:
_lfs_tracked_files(worktree/workspace_clone.py:114-131) doesshutil.which("git-lfs")plus agit lfs ls-files --name-onlysubprocess, then_has_lfs_pointersopens the first 23 bytes of every tracked file — even for the overwhelmingly common repo with no LFS at all. Gate it so a non-LFS repo pays (at most) one cheap local check instead of agit lfsfork.Shape of the fix (refine test-first): before forking
git lfs, check whether the clone can possibly use LFS — e.g..gitattributes(tracked or top-level) mentioningfilter=lfs— and skip the whole probe when it can't. The existing deliberate choice at workspace_clone.py:350-352 (do NOT gate onis_new_workspace, so a previously failed pull isn't permanent) must be preserved: the gate must be a property of the repo content, not of launch history.Done when:
git lfssubprocess is spawned (extend the spawn-count seam or mock at the subprocess boundary).filter=lfsattributes still probes and materializes exactly as today (existing tests stay green).pixi run ci, check py310).