diff --git a/.story_kit/bugs/bug-2-agent-panel-expand-does-nothing.md b/.story_kit/bugs/bug-2-agent-panel-expand-does-nothing.md new file mode 100644 index 0000000..3b98475 --- /dev/null +++ b/.story_kit/bugs/bug-2-agent-panel-expand-does-nothing.md @@ -0,0 +1,24 @@ +--- +name: Agent panel expand triangle does nothing without running agent +--- + +# Bug 2: Agent Panel Expand Triangle Does Nothing + +## Symptom + +Clicking the expand triangle (▶) next to a story in the Agent panel does nothing visible. No detail panel opens, no console output. + +## Root Cause + +The expand handler sets `expandedKey` to `storyAgentEntries[0]?.[0] ?? story.story_id`. If no agents have been started for the story, `storyAgentEntries` is empty, so `expandedKey` gets set to `story.story_id`. But the detail section only renders entries from `storyAgentEntries.map(...)`, which is empty — so nothing renders even though `expandedKey` is set. + +## Reproduction Steps + +1. Start the server and open the web UI +2. Ensure there are upcoming stories visible in the Agent panel +3. Click the ▶ triangle next to any story (without starting an agent first) +4. Observe: nothing happens + +## Proposed Fix + +Either disable the expand triangle when no agents exist for the story, or show a "No agent running" message in the detail panel when expanded without agents. diff --git a/.story_kit/bugs/bug-3-stale-worktree-blocks-agent-start.md b/.story_kit/bugs/bug-3-stale-worktree-blocks-agent-start.md new file mode 100644 index 0000000..8ee755b --- /dev/null +++ b/.story_kit/bugs/bug-3-stale-worktree-blocks-agent-start.md @@ -0,0 +1,24 @@ +--- +name: Stale worktree references block agent start +--- + +# Bug 3: Stale Worktree References Block Agent Start + +## Symptom + +Starting an agent fails with `git worktree add failed: ... is already used by worktree` even though the worktree directory no longer exists. + +## Root Cause + +When a worktree directory is deleted externally (e.g., `rm -rf` by another agent or manual cleanup) without running `git worktree remove` or `git worktree prune`, git retains a stale reference. The `create_worktree` function in `worktree.rs` checks if the directory exists (line 43) but doesn't handle the case where git still thinks the branch is checked out in a now-deleted worktree. + +## Reproduction Steps + +1. Start an agent (creates worktree and branch) +2. Delete the worktree directory externally (`rm -rf`) +3. Try to start an agent for the same story again +4. Observe: `git worktree add` fails because git still references the old worktree + +## Proposed Fix + +Run `git worktree prune` before attempting `git worktree add` in `create_worktree_sync()`, or handle the "already used" error by pruning and retrying.