fix(convoy): ensure custom types before convoy creation

Add EnsureCustomTypes call to createAutoConvoy (sling) and
executeConvoyFormula (formula) to ensure the 'convoy' type is
registered before attempting to create convoy beads.

This fixes "validation failed: invalid issue type: convoy" errors
that occurred when convoy creation was attempted before custom types
were configured in the beads database.

Fixes: hq-ledua

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
coma
2026-01-26 12:37:49 -08:00
committed by John Ogle
parent 1f364ee540
commit a1f843c11d
2 changed files with 12 additions and 0 deletions

View File

@@ -315,6 +315,12 @@ func executeConvoyFormula(f *formulaData, formulaName, targetRig string) error {
}
townBeads := filepath.Join(townRoot, ".beads")
// 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)
}
// Step 1: Create convoy bead
convoyID := fmt.Sprintf("hq-cv-%s", generateFormulaShortID())
convoyTitle := fmt.Sprintf("%s: %s", formulaName, f.Description)

View File

@@ -71,6 +71,12 @@ func createAutoConvoy(beadID, beadTitle string, epicID string) (string, error) {
townBeads := filepath.Join(townRoot, ".beads")
// 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)
}
// Generate convoy ID with hq-cv- prefix for visual distinction
// The hq-cv- prefix is registered in routes during gt install
convoyID := fmt.Sprintf("hq-cv-%s", slingGenerateShortID())