fix(convoy): ensure custom types registered before creating convoy

Call beads.EnsureCustomTypes before attempting to create a convoy.
This fixes invalid issue type: convoy errors that occur when town
beads do not have custom types configured (e.g., incomplete install
or manually initialized beads).

The EnsureCustomTypes function uses caching (in-memory + sentinel file)
so this adds negligible overhead to convoy create.

Fixes: gt-1b8eg9

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
furiosa
2026-01-22 21:38:41 -08:00
committed by John Ogle
parent 09dc3a31e7
commit 7a62d2d401

View File

@@ -320,6 +320,12 @@ func runConvoyCreate(cmd *cobra.Command, args []string) error {
return err
}
// Ensure custom types (including 'convoy') are registered in town beads.
// This handles cases where install didn't complete or beads was initialized manually.
if err := beads.EnsureCustomTypes(townBeads); err != nil {
return fmt.Errorf("ensuring custom types: %w", err)
}
// Create convoy issue in town beads
description := fmt.Sprintf("Convoy tracking %d issues", len(trackedIssues))