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:
@@ -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)
|
// Update agent bead with new state and clear hook_bead (work is done)
|
||||||
// Use town root for routing - ensures cross-beads references work
|
// Use rig path for slot commands - bd slot doesn't route from town root
|
||||||
bd := beads.New(townRoot)
|
var beadsPath string
|
||||||
|
switch ctx.Role {
|
||||||
|
case RoleMayor, RoleDeacon:
|
||||||
|
beadsPath = townRoot
|
||||||
|
default:
|
||||||
|
beadsPath = filepath.Join(townRoot, ctx.Rig)
|
||||||
|
}
|
||||||
|
bd := beads.New(beadsPath)
|
||||||
emptyHook := ""
|
emptyHook := ""
|
||||||
if err := bd.UpdateAgentState(agentBeadID, newState, &emptyHook); err != nil {
|
if err := bd.UpdateAgentState(agentBeadID, newState, &emptyHook); err != nil {
|
||||||
// Log warning instead of silent ignore - helps debug cross-beads issues
|
// Log warning instead of silent ignore - helps debug cross-beads issues
|
||||||
|
|||||||
Reference in New Issue
Block a user