Observed (2026-09-03, ~11:5x)
A subagent foreground dispatch failed at backend creation:
backend create failed: npm install @getpipher/pi-statusline@0.4.5 --prefix /Users/rector/.pi/agent/npm --legacy-peer-deps failed with code 1
A manual re-run of the identical command minutes later: up to date in 862ms (success). Version 0.4.5 exists on npm and is the settings pin — not a missing-package problem.
Suspected cause
Two pi sessions (RECTOR runs several in parallel) each spawning child sessions → concurrent npm install --prefix <shared ~/.pi/agent/npm> racing on the same node_modules. npm has no cross-process install lock by default; a transient code-1 (EEXIST/ENOENT during tree mutation) is the expected failure shape. The failing dispatch died at creation; the retry succeeded once the other session's install settled.
Impact
- Dispatch creation fails spuriously under parallel-session load — looks like a fleet bug to the controller, is an environment race.
- No retry happens at this layer today (backend creation failure = dispatch fails).
Ask
- Reproduce: two sessions dispatching simultaneously with a cold/invalidated
~/.pi/agent/npm prefix.
- Consider a serialized install guard (lockfile around the substrate install) or one bounded retry with backoff on
backend create failed before surfacing the error.
Observed (2026-09-03, ~11:5x)
A
subagentforeground dispatch failed at backend creation:A manual re-run of the identical command minutes later:
up to date in 862ms(success). Version 0.4.5 exists on npm and is the settings pin — not a missing-package problem.Suspected cause
Two pi sessions (RECTOR runs several in parallel) each spawning child sessions → concurrent
npm install --prefix <shared ~/.pi/agent/npm>racing on the same node_modules. npm has no cross-process install lock by default; a transient code-1 (EEXIST/ENOENT during tree mutation) is the expected failure shape. The failing dispatch died at creation; the retry succeeded once the other session's install settled.Impact
Ask
~/.pi/agent/npmprefix.backend create failedbefore surfacing the error.