From e11bcb931eb11646a12f7e79362020039d56d5c6 Mon Sep 17 00:00:00 2001 From: gastown/witness Date: Sun, 4 Jan 2026 20:28:28 -0500 Subject: [PATCH] fix(sling): Format cross-rig beads as external refs in convoy tracking When creating auto-convoys for cross-rig beads (e.g., gt-xxx or gu-xxx), the tracking relation was failing because bd couldn't resolve the bead ID from HQ context. Now formats non-HQ beads as external:prefix:id for proper resolution. Fixes convoy tracking for cross-rig sling operations. --- internal/cmd/sling.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/internal/cmd/sling.go b/internal/cmd/sling.go index 39da5e46..011fb5c9 100644 --- a/internal/cmd/sling.go +++ b/internal/cmd/sling.go @@ -1240,7 +1240,16 @@ func createAutoConvoy(beadID, beadTitle string) (string, error) { } // Add tracking relation: convoy tracks the issue - depArgs := []string{"dep", "add", convoyID, beadID, "--type=tracks"} + // Format cross-prefix beads as external refs so bd can resolve them + trackBeadID := beadID + if !strings.HasPrefix(beadID, "hq-") { + parts := strings.SplitN(beadID, "-", 3) + if len(parts) >= 2 { + rigPrefix := parts[0] + "-" + parts[1] + trackBeadID = fmt.Sprintf("external:%s:%s", rigPrefix, beadID) + } + } + depArgs := []string{"dep", "add", convoyID, trackBeadID, "--type=tracks"} depCmd := exec.Command("bd", depArgs...) depCmd.Dir = townBeads depCmd.Stderr = os.Stderr @@ -1278,10 +1287,10 @@ func runBatchSling(beadIDs []string, rigName string, townBeadsDir string) error // Track results for summary type slingResult struct { - beadID string - polecat string - success bool - errMsg string + beadID string + polecat string + success bool + errMsg string } results := make([]slingResult, 0, len(beadIDs))