huskies: merge 645_bug_agent_runtime_panics_with_output_write_bytes_is_ok_assertion_marking_stories_falsely_blocked

This commit is contained in:
dave
2026-04-26 10:50:40 +00:00
parent d8f9be5b23
commit f88bb5f486
5 changed files with 526 additions and 2 deletions
+19
View File
@@ -181,6 +181,25 @@ The mergemaster agent only runs against stories in `4_merge/`. It:
4. On failure beyond the retry budget, writes `merge_failure` and blocks the
story (auto-assign then skips it).
### Agent terminated with committed work (bug 645 recovery path)
When a coder agent terminates abnormally (e.g. the Claude Code CLI's
`output.write(&bytes).is_ok()` PTY write assertion fires mid-session), the
server-owned completion path detects the crash and checks for surviving work:
1. If the worktree is dirty but has commits ahead of master, reset the
uncommitted files (`git checkout . && git clean -fd`) and run gates
against the committed code.
2. If gates still fail but `git log master..HEAD` shows commits and
`cargo check` passes, **advance to QA** instead of entering the
retry/block path. This is the "work survived" check, implemented in
`server/src/agents/pool/pipeline/advance.rs`.
3. Agents that die WITHOUT committed work (no commits ahead of master)
still follow the existing retry → block path unchanged.
This prevents false-positive blocking of stories where the agent completed
meaningful work before crashing.
### Watchdog (current production)
The "watchdog" at `server/src/agents/pool/auto_assign/watchdog.rs` runs every