Skip to content

Commit 095a426

Browse files
steveyeggeclaude
andcommitted
fix: Clear polecat hook on completion by using rig path (gt-2wc1n)
The bd slot command doesn't route correctly from town root - it only works when run from the rig directory. This fix changes done.go to use the rig path (filepath.Join(townRoot, ctx.Rig)) instead of townRoot when calling slot commands. Bug: gt polecat nuke was blocked by stale hooks on closed beads because gt done wasn't actually clearing the hook_bead field. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ae9741a commit 095a426

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

internal/cmd/done.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,15 @@ func updateAgentStateOnDone(cwd, townRoot, exitType, _ string) { // issueID unus
393393
}
394394

395395
// Update agent bead with new state and clear hook_bead (work is done)
396-
// Use town root for routing - ensures cross-beads references work
397-
bd := beads.New(townRoot)
396+
// Use rig path for slot commands - bd slot doesn't route from town root
397+
var beadsPath string
398+
switch ctx.Role {
399+
case RoleMayor, RoleDeacon:
400+
beadsPath = townRoot
401+
default:
402+
beadsPath = filepath.Join(townRoot, ctx.Rig)
403+
}
404+
bd := beads.New(beadsPath)
398405
emptyHook := ""
399406
if err := bd.UpdateAgentState(agentBeadID, newState, &emptyHook); err != nil {
400407
// Log warning instead of silent ignore - helps debug cross-beads issues

0 commit comments

Comments
 (0)