diff --git a/.story_kit/work/4_merge/95_bug_pipeline_auto_restart_has_no_retry_limit_causing_infinite_loop.md b/.story_kit/work/5_archived/95_bug_pipeline_auto_restart_has_no_retry_limit_causing_infinite_loop.md similarity index 100% rename from .story_kit/work/4_merge/95_bug_pipeline_auto_restart_has_no_retry_limit_causing_infinite_loop.md rename to .story_kit/work/5_archived/95_bug_pipeline_auto_restart_has_no_retry_limit_causing_infinite_loop.md diff --git a/frontend/src/components/AgentPanel.test.tsx b/frontend/src/components/AgentPanel.test.tsx index 0b97891..817da39 100644 --- a/frontend/src/components/AgentPanel.test.tsx +++ b/frontend/src/components/AgentPanel.test.tsx @@ -144,6 +144,28 @@ describe("RosterBadge availability state", () => { expect(badge.style.color).toBe("rgb(170, 170, 170)"); }); + // AC2: after agent completes and returns to roster, badge shows idle + it("shows idle state after agent status changes from running to completed", async () => { + const agentList: AgentInfo[] = [ + { + story_id: "81_completed", + agent_name: "coder-1", + status: "completed", + session_id: null, + worktree_path: null, + base_branch: null, + }, + ]; + mockedAgents.listAgents.mockResolvedValue(agentList); + + render(); + + const badge = await screen.findByTestId("roster-badge-coder-1"); + // Always idle: grey background and grey text + expect(badge.style.background).toBe("rgba(170, 170, 170, 0.094)"); + expect(badge.style.color).toBe("rgb(170, 170, 170)"); + }); + // AC2: after agent completes and returns to roster, badge shows idle it("shows idle state after agent status changes from running to completed", async () => { const agentList: AgentInfo[] = [