fix: Use rig's configured prefix for agent bead IDs (gt-kdy77, gt-ihvq0)

Added WithPrefix variants to agent bead ID functions:
- AgentBeadIDWithPrefix(prefix, rig, role, name)
- WitnessBeadIDWithPrefix, RefineryBeadIDWithPrefix
- CrewBeadIDWithPrefix, PolecatBeadIDWithPrefix

Updated callers to use rig's configured prefix:
- crew_add.go: reads r.Config.Prefix for crew worker beads
- rig/manager.go: uses prefix param for witness/refinery beads
- doctor/agent_beads_check.go: uses prefix from routes.jsonl

This allows non-gastown rigs (like beads with bd- prefix) to have
properly-prefixed agent beads.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-29 15:28:53 -08:00
parent 5260a9ca08
commit 87bc02b009
4 changed files with 60 additions and 57 deletions

View File

@@ -81,7 +81,12 @@ func runCrewAdd(cmd *cobra.Command, args []string) error {
// Create agent bead for the crew worker
rigBeadsPath := filepath.Join(r.Path, "mayor", "rig")
bd := beads.New(rigBeadsPath)
crewID := beads.CrewBeadID(rigName, name)
// Use the rig's configured prefix, defaulting to "gt" for backward compatibility
prefix := "gt"
if r.Config != nil && r.Config.Prefix != "" {
prefix = r.Config.Prefix
}
crewID := beads.CrewBeadIDWithPrefix(prefix, rigName, name)
if _, err := bd.Show(crewID); err != nil {
// Agent bead doesn't exist, create it
fields := &beads.AgentFields{