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:
@@ -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)
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user