f16545ec36
The reader thread spawned in run_agent_pty_blocking was never joined, leaving a cloned PTY master fd open after the agent exited. When the pipeline restarted the agent on the same worktree, the stale fd from the previous session interfered with the new PTY allocation, causing Claude Code's bundled ripgrep to crash with: fatal runtime error: assertion failed: output.write(&bytes).is_ok() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>