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>
This commit is contained in:
corpus
2026-01-04 15:17:21 -08:00
committed by Steve Yegge
parent ae9741ad7f
commit 095a426ebf

View File

@@ -393,8 +393,15 @@ func updateAgentStateOnDone(cwd, townRoot, exitType, _ string) { // issueID unus
}
// Update agent bead with new state and clear hook_bead (work is done)
// Use town root for routing - ensures cross-beads references work
bd := beads.New(townRoot)
// Use rig path for slot commands - bd slot doesn't route from town root
var beadsPath string
switch ctx.Role {
case RoleMayor, RoleDeacon:
beadsPath = townRoot
default:
beadsPath = filepath.Join(townRoot, ctx.Rig)
}
bd := beads.New(beadsPath)
emptyHook := ""
if err := bd.UpdateAgentState(agentBeadID, newState, &emptyHook); err != nil {
// Log warning instead of silent ignore - helps debug cross-beads issues