From 87d79c40ee5ff48efe288bc6712949581db2b373 Mon Sep 17 00:00:00 2001 From: angharad Date: Fri, 2 Jan 2026 01:25:14 -0800 Subject: [PATCH] fix(hook): Use consistent 3-part polecat identity format (gt-6zzvi) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit buildAgentIdentity was returning 2-part format (rig/name) while sling.go sets assignee using 3-part format (rig/polecats/name) from session.AgentIdentity.Address(). This mismatch caused gt hook to fail when querying for hooked beads by assignee. Changes: - buildAgentIdentity: Return rig/polecats/name for polecats - buildAgentBeadID: Handle both 2-part and 3-part formats 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/molecule_status.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/cmd/molecule_status.go b/internal/cmd/molecule_status.go index ba08dd39..144988fa 100644 --- a/internal/cmd/molecule_status.go +++ b/internal/cmd/molecule_status.go @@ -71,6 +71,10 @@ func buildAgentBeadID(identity string, role Role) string { } return "" case RolePolecat: + // Handle both 2-part (rig/name) and 3-part (rig/polecats/name) formats + if len(parts) == 3 && parts[1] == "polecats" { + return beads.PolecatBeadID(parts[0], parts[2]) + } if len(parts) >= 2 { return beads.PolecatBeadID(parts[0], parts[1]) } @@ -423,6 +427,7 @@ func runMoleculeStatus(cmd *cobra.Command, args []string) error { } // buildAgentIdentity constructs the agent identity string from role context. +// Format matches session.AgentIdentity.Address() for consistency. func buildAgentIdentity(ctx RoleContext) string { switch ctx.Role { case RoleMayor: @@ -434,7 +439,7 @@ func buildAgentIdentity(ctx RoleContext) string { case RoleRefinery: return ctx.Rig + "/refinery" case RolePolecat: - return ctx.Rig + "/" + ctx.Polecat + return ctx.Rig + "/polecats/" + ctx.Polecat case RoleCrew: return ctx.Rig + "/crew/" + ctx.Polecat default: