---
name: "QA agent not stopped when story moves to merge stage"
---

# Bug 223: QA agent not stopped when story moves to merge stage

## Description

When a story transitions from work/3_qa/ to work/4_merge/ (via move_story_to_merge), any running QA agent for that story is not automatically stopped. This leaves a stale agent process running against a story that has already moved past QA.

## How to Reproduce

1. Have a story in work/2_current/ with a completed worktree
2. Call request_qa to move it to work/3_qa/ — this spawns the qa agent
3. Once QA completes (or while it's still running), call move_story_to_merge
4. Check list_agents — the qa agent still shows as running on the story

## Actual Result

The QA agent remains running after the story moves to work/4_merge/. It shows up in list_agents as active on a story that is now in the merge stage.

## Expected Result

When a story transitions out of work/3_qa/, any running QA agent for that story should be automatically stopped before the story file is moved.

## Acceptance Criteria

- [ ] move_story_to_merge stops any running agent for the story before moving the story file
- [ ] No stale agents remain after a story stage transition
