Fix agent bead ID prefix - always use gt- not rig prefix
Agent beads must use gt- prefix (required by beads validation). Only issue beads use rig-specific prefixes (ga-, bd-, etc.). Fixed in: - crew_add.go: Use CrewBeadID() not CrewBeadIDWithPrefix() - prime.go: Use non-prefix variants for all agent types - sling.go: Use non-prefix variants for all agent types This fixes 'invalid agent ID' error when creating crew in rigs with non-gt prefix (e.g., gastown with ga- prefix). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1170,18 +1170,11 @@ func getAgentFields(ctx RoleContext, state string) *beads.AgentFields {
|
||||
}
|
||||
|
||||
// getAgentBeadID returns the agent bead ID for the current role.
|
||||
// Uses canonical naming: prefix-rig-role-name
|
||||
// The prefix is looked up from routes.jsonl to support rigs with custom prefixes.
|
||||
// Uses canonical naming: gt-rig-role-name
|
||||
// Agent beads always use "gt-" prefix (required by beads validation).
|
||||
// Only issue beads use rig-specific prefixes.
|
||||
// Returns empty string for unknown roles.
|
||||
func getAgentBeadID(ctx RoleContext) string {
|
||||
// Helper to get prefix for rig-level agents
|
||||
getPrefix := func() string {
|
||||
if ctx.TownRoot != "" && ctx.Rig != "" {
|
||||
return beads.GetPrefixForRig(ctx.TownRoot, ctx.Rig)
|
||||
}
|
||||
return "gt" // Default prefix
|
||||
}
|
||||
|
||||
switch ctx.Role {
|
||||
case RoleMayor:
|
||||
return beads.MayorBeadID()
|
||||
@@ -1189,22 +1182,22 @@ func getAgentBeadID(ctx RoleContext) string {
|
||||
return beads.DeaconBeadID()
|
||||
case RoleWitness:
|
||||
if ctx.Rig != "" {
|
||||
return beads.WitnessBeadIDWithPrefix(getPrefix(), ctx.Rig)
|
||||
return beads.WitnessBeadID(ctx.Rig)
|
||||
}
|
||||
return ""
|
||||
case RoleRefinery:
|
||||
if ctx.Rig != "" {
|
||||
return beads.RefineryBeadIDWithPrefix(getPrefix(), ctx.Rig)
|
||||
return beads.RefineryBeadID(ctx.Rig)
|
||||
}
|
||||
return ""
|
||||
case RolePolecat:
|
||||
if ctx.Rig != "" && ctx.Polecat != "" {
|
||||
return beads.PolecatBeadIDWithPrefix(getPrefix(), ctx.Rig, ctx.Polecat)
|
||||
return beads.PolecatBeadID(ctx.Rig, ctx.Polecat)
|
||||
}
|
||||
return ""
|
||||
case RoleCrew:
|
||||
if ctx.Rig != "" && ctx.Polecat != "" {
|
||||
return beads.CrewBeadIDWithPrefix(getPrefix(), ctx.Rig, ctx.Polecat)
|
||||
return beads.CrewBeadID(ctx.Rig, ctx.Polecat)
|
||||
}
|
||||
return ""
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user