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 <noreply@anthropic.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user