Started with `open -a`, magpie ran but took over 60s to write
"started", while the same binary run from a shell started in 1s. The
reporter's trace: startUp → agent.RenameLegacy → onMachine →
vscodePortableData → binAt("code-insiders"). Without Insiders,
exec.LookPath walks all of PATH, and a folder on a mount that no longer
answers holds open()/stat() until it does, before applog.Start.
The block isn't binAt's alone: startUp builds every agent through
local() in RenameLegacy and again in moveEfforts (Cursor's and
Antigravity's), each asking for its command through binAt/proc, all
walking the same PATH, and lookStamp stats every PATH folder first. So
the bound is where all of them pass, in proc (reach.go): each PATH
folder is asked (a stat and an open) in a goroutine of its own, all at
once, and one that hasn't answered in 1s is left out of the stamp and of
the look until its probe returns; a probe still out isn't started again,
so later looks skip the folder at once. With such a folder, the command
is looked for in the others, each as a path (exec.LookPath on dir/name).
An answer is trusted for a minute. findMise and FindShell's last resort
used exec.LookPath directly and now go through Look.
Test: TestHungPathFolderIsLeftOut puts a folder whose probe never
returns before the folder with the tool: three looks find the tool, PATH
is never walked whole, the folder is probed once; once it answers, PATH
is walked as before.
Run: go test ./internal/proc ./internal/claudetui on mote ok; go vet for
darwin, linux and windows ok; the proc look tests on the Windows box
(win-run) ok.
Broken by hand: with lookPath not asking hungDirs, the test is red
("PATH was walked 3 times", wsl-run).
Not tried: a real dead network mount on PATH; the test fakes it at the
probe. Direct exec.LookPath calls outside proc (daemon, library, update)
aren't on the startup path and are unchanged.