diff --git a/.storkit/work/1_backlog/452_bug_claude_code_pty_crashes_with_fatal_runtime_error_on_agent_restart.md b/.storkit/work/1_backlog/452_bug_claude_code_pty_crashes_with_fatal_runtime_error_on_agent_restart.md new file mode 100644 index 00000000..55de68a6 --- /dev/null +++ b/.storkit/work/1_backlog/452_bug_claude_code_pty_crashes_with_fatal_runtime_error_on_agent_restart.md @@ -0,0 +1,26 @@ +--- +name: "Claude Code PTY crashes with fatal runtime error on agent restart" +--- + +# Bug 452: Claude Code PTY crashes with fatal runtime error on agent restart + +## Description + +When an agent is restarted on a worktree where coding is already complete (clean worktree, all changes committed), the Claude Code PTY process crashes immediately on startup with `fatal runtime error: assertion failed: output.write(&bytes).is_ok(), aborting`. The process exits in the same second it spawns, with `Session: None`. This burns through retries and blocks the story. The crash comes from inside the Claude Code binary itself, not storkit code. Observed on both story 449 and 450 worktrees. + +## How to Reproduce + +Have a story in current stage with a worktree that has all coding done and committed (clean `git status`). Let the gates fail for an unrelated reason (e.g. a test failure). The pipeline restarts the agent on the same worktree. The Claude Code process crashes immediately with the fatal runtime error. + +## Actual Result + +`fatal runtime error: assertion failed: output.write(&bytes).is_ok(), aborting` — process exits instantly, session is None, burns retries. + +## Expected Result + +Claude Code should start successfully on the worktree and the agent should be able to fix any gate failures. + +## Acceptance Criteria + +- [ ] Agent restart on a worktree with committed work does not crash the PTY +- [ ] If Claude Code fails to start, the error is handled gracefully without burning retries