diff --git a/.story_kit/work/1_upcoming/118_bug_agent_pool_retains_stale_running_state_after_completion_blocking_auto_assign.md b/.story_kit/work/1_upcoming/118_bug_agent_pool_retains_stale_running_state_after_completion_blocking_auto_assign.md new file mode 100644 index 0000000..ccae866 --- /dev/null +++ b/.story_kit/work/1_upcoming/118_bug_agent_pool_retains_stale_running_state_after_completion_blocking_auto_assign.md @@ -0,0 +1,31 @@ +--- +name: "Agent pool retains stale running state after completion, blocking auto-assign" +--- + +# Bug 118: Agent pool retains stale running state after completion, blocking auto-assign + +## Description + +When an agent (QA, mergemaster) completes its work and the story advances in the pipeline, the agent pool still reports the agent as running on the old story. This blocks auto-assign from picking up new work in the queue. + +This is different from bug 94 (stale state after restart). This happens during normal operation within a single server session. + +## How to Reproduce + +1. Have mergemaster complete a merge (e.g. story 106) +2. Story moves to archived +3. New items arrive in 4_merge/ (e.g. 107, 108, 109) +4. Try to start mergemaster on a new story +5. Server responds: Agent mergemaster is already running on story 106 + +## Actual Result + +Agent pool reports mergemaster as running on the completed/archived story. Auto-assign skips the merge queue. Manual stop of the stale entry is required before the agent can be reassigned. + +## Expected Result + +When an agent process exits and the story advances, the agent pool should clear the running state so auto-assign can immediately dispatch the agent to the next queued item. + +## Acceptance Criteria + +- [ ] Bug is fixed and verified