fix: use rig prefixes for agent bead IDs

Align rig-scoped agent beads with route prefixes so crew add/prime/status resolve the same IDs across rigs. Add tests that assert rig-prefixed agent IDs in prime and status.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Dan Shapiro
2026-01-01 18:07:46 -08:00
parent b0c7c89be1
commit b91dd43697
5 changed files with 257 additions and 42 deletions

View File

@@ -100,7 +100,8 @@ func runCrewAdd(cmd *cobra.Command, args []string) error {
fmt.Printf(" Branch: %s\n", worker.Branch)
// Create agent bead for the crew worker
crewID := beads.CrewBeadID(rigName, name)
prefix := beads.GetPrefixForRig(townRoot, rigName)
crewID := beads.CrewBeadIDWithPrefix(prefix, rigName, name)
if _, err := bd.Show(crewID); err != nil {
// Agent bead doesn't exist, create it
fields := &beads.AgentFields{