From c42b5db7ab9c3cd98aaa69d5a60a2629de7e7fd6 Mon Sep 17 00:00:00 2001 From: mayor Date: Wed, 21 Jan 2026 19:49:01 -0800 Subject: [PATCH] fix(hook): normalize agent ID trailing slash in agentIDToBeadID (gt-az3jjb) resolveSelfTarget returns "mayor/" with trailing slash per addressToIdentity normalization, but agentIDToBeadID only checked for "mayor" without slash. This caused `gt hook --clear` to fail with: Error: could not convert agent ID mayor/ to bead ID Co-Authored-By: Claude Opus 4.5 --- internal/cmd/sling_helpers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/cmd/sling_helpers.go b/internal/cmd/sling_helpers.go index 71b4ef9e..24fe25b9 100644 --- a/internal/cmd/sling_helpers.go +++ b/internal/cmd/sling_helpers.go @@ -345,6 +345,9 @@ func detectActor() string { // Rig-level agents use the rig's configured prefix (default "gt-"). // townRoot is needed to look up the rig's configured prefix. func agentIDToBeadID(agentID, townRoot string) string { + // Normalize: strip trailing slash (resolveSelfTarget returns "mayor/" not "mayor") + agentID = strings.TrimSuffix(agentID, "/") + // Handle simple cases (town-level agents with hq- prefix) if agentID == "mayor" { return beads.MayorBeadIDTown()