fix(hook): Use consistent 3-part polecat identity format (gt-6zzvi)
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 <noreply@anthropic.com>
This commit is contained in:
@@ -71,6 +71,10 @@ func buildAgentBeadID(identity string, role Role) string {
|
|||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
case RolePolecat:
|
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 {
|
if len(parts) >= 2 {
|
||||||
return beads.PolecatBeadID(parts[0], parts[1])
|
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.
|
// buildAgentIdentity constructs the agent identity string from role context.
|
||||||
|
// Format matches session.AgentIdentity.Address() for consistency.
|
||||||
func buildAgentIdentity(ctx RoleContext) string {
|
func buildAgentIdentity(ctx RoleContext) string {
|
||||||
switch ctx.Role {
|
switch ctx.Role {
|
||||||
case RoleMayor:
|
case RoleMayor:
|
||||||
@@ -434,7 +439,7 @@ func buildAgentIdentity(ctx RoleContext) string {
|
|||||||
case RoleRefinery:
|
case RoleRefinery:
|
||||||
return ctx.Rig + "/refinery"
|
return ctx.Rig + "/refinery"
|
||||||
case RolePolecat:
|
case RolePolecat:
|
||||||
return ctx.Rig + "/" + ctx.Polecat
|
return ctx.Rig + "/polecats/" + ctx.Polecat
|
||||||
case RoleCrew:
|
case RoleCrew:
|
||||||
return ctx.Rig + "/crew/" + ctx.Polecat
|
return ctx.Rig + "/crew/" + ctx.Polecat
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user