You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tower: afx architect spawns claude without sanitizing inherited CLAUDE_CODE_* env #1627
Split out from the #1219 CMAP review (PR #1626) so it is tracked rather than left in a PR body.
agent-farm/commands/architect.ts:37 spawns claude with { ...process.env, ...env }. It has never stripped CLAUDECODE either, so this is pre-existing rather than a regression from #1626 — and it is outside Tower, which is why #1626 deliberately left it alone.
The consequence is the same as #1219's: running afx architect from inside a Claude Code session gives the new architect a nested-session marker, so its transcript saving is off and the session cannot be resumed.
The machinery already exists — sanitizeAgentEnv() in packages/codev/src/lib/agent-env.ts. This is a one-line change plus an entry in the SPAWN_SITES table in bugfix-1219-claude-env-leak.test.ts, which pins per-file sanitizer call counts.
Worth checking the same way while in there: codev init / adopt's execAsync calls also inherit raw process.env, though those are not agent-spawning paths.
Activity