run_command_with_timeout piped stdout/stderr but only read them after
the child exited. When test output exceeded the 64KB OS pipe buffer,
the child blocked on write() while the parent blocked on waitpid() —
a permanent deadlock that caused every merge pipeline to hang.
Drain both pipes in background threads so the buffers never fill.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The merge pipeline (squash merge + quality gates) takes well over 60
seconds. Claude Code's MCP HTTP transport times out at 60s, causing
"completed with no output" — the mergemaster retries fruitlessly.
merge_agent_work now starts the pipeline as a background task and
returns immediately. A new get_merge_status tool lets the mergemaster
poll until the job reaches a terminal state. Also adds a double-start
guard so concurrent calls for the same story are rejected.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Test commands in run_project_tests now use wait-timeout to enforce a
600-second ceiling, preventing hung processes (e.g. Playwright with no
server) from blocking the merge pipeline indefinitely. Also disables
e2e tests in script/test until the merge workspace can run them safely.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds an optional `agent:` field to story file front matter so that a
specific agent can be requested for a story. The auto-assign loop now:
1. Reads the front-matter `agent` field for each story before picking
a free agent.
2. If a preferred agent is named, uses it when free; skips the story
(without falling back) when that agent is busy.
3. Falls back to the existing `find_free_agent_for_stage` behaviour
when no preference is specified.
Ported from feature branch that predated the agents.rs module refactoring.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split the monolithic agents.rs into 6 focused modules:
- mod.rs: shared types (AgentEvent, AgentStatus, etc.) and re-exports
- pool.rs: AgentPool struct, all methods, and helper free functions
- pty.rs: PTY streaming (run_agent_pty_blocking, emit_event)
- lifecycle.rs: story movement functions (move_story_to_qa, etc.)
- gates.rs: acceptance gates (clippy, tests, coverage)
- merge.rs: squash-merge, conflict resolution, quality gates
All 121 original tests are preserved and distributed across modules.
Also adds clear_front_matter_field to story_metadata.rs to strip
stale merge_failure from front matter when stories move to done.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>