From 095a426ebfdf9f77d960c2989834c0fc8c91489e Mon Sep 17 00:00:00 2001 From: corpus Date: Sun, 4 Jan 2026 15:17:21 -0800 Subject: [PATCH] fix: Clear polecat hook on completion by using rig path (gt-2wc1n) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- internal/cmd/done.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/cmd/done.go b/internal/cmd/done.go index edb1f53f..46fde95f 100644 --- a/internal/cmd/done.go +++ b/internal/cmd/done.go @@ -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