fix: Register custom beads types during install (#250)

During `gt install`, the beads database is initialized but Gas Town's
custom issue types (agent, role, rig, convoy, slot) were not being
registered. This caused subsequent agent bead creation to fail with
"invalid issue type: agent" errors.

The fix adds `bd config set types.custom "agent,role,rig,convoy,slot"`
after `bd init` completes. This is idempotent and safe to run multiple
times.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
tajquitgenius
2026-01-07 22:17:39 -05:00
committed by GitHub
parent 6209a49d54
commit 585c204648

View File

@@ -321,6 +321,14 @@ func initTownBeads(townPath string) error {
fmt.Printf(" %s Could not verify repo fingerprint: %v\n", style.Dim.Render("⚠"), err)
}
// Register Gas Town custom types (agent, role, rig, convoy, slot).
// These types are not built into beads core - they must be registered
// before creating agent/role beads. See GH #gt-xyz for context.
if err := ensureCustomTypes(townPath); err != nil {
// Non-fatal but will cause agent bead creation to fail
fmt.Printf(" %s Could not register custom types: %v\n", style.Dim.Render("⚠"), err)
}
return nil
}
@@ -337,6 +345,20 @@ func ensureRepoFingerprint(beadsPath string) error {
return nil
}
// ensureCustomTypes registers Gas Town custom issue types with beads.
// Beads core only supports built-in types (bug, feature, task, etc.).
// Gas Town needs custom types: agent, role, rig, convoy, slot.
// This is idempotent - safe to call multiple times.
func ensureCustomTypes(beadsPath string) error {
cmd := exec.Command("bd", "config", "set", "types.custom", "agent,role,rig,convoy,slot")
cmd.Dir = beadsPath
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("bd config set types.custom: %s", strings.TrimSpace(string(output)))
}
return nil
}
// initTownAgentBeads creates town-level agent and role beads using hq- prefix.
// This creates:
// - hq-mayor, hq-deacon (agent beads for town-level agents)