fix: persist PATH in .spawnrc so agent binaries work on SSH reconnect (#2355)

Previously .spawnrc only exported env vars (API keys). The PATH entries
for agent binaries (~/.npm-global/bin, ~/.bun/bin, etc.) were only set
in per-agent launch commands, so reconnecting via SSH left users with
"command not found" errors.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: L <6723574+louisgv@users.noreply.github.com>
This commit is contained in:
Ahmed Abushagur 2026-03-08 18:48:18 -07:00 committed by GitHub
parent bd1399c861
commit e02040e33e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,6 +42,8 @@ export function generateEnvConfig(pairs: string[]): string {
"",
"# [spawn:env]",
"export IS_SANDBOX='1'",
"# Ensure agent binaries are in PATH on reconnect",
'export PATH="$HOME/.npm-global/bin:$HOME/.bun/bin:$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.claude/local/bin:$PATH"',
];
for (const pair of pairs) {
const eqIdx = pair.indexOf("=");