Merge pull request #123 from akatz-ai/fix/convoy-cross-rig-tracking
fix(sling): Format cross-rig beads as external refs in convoy tracking
This commit is contained in:
@@ -1242,7 +1242,8 @@ func createAutoConvoy(beadID, beadTitle string) (string, error) {
|
||||
}
|
||||
|
||||
// Add tracking relation: convoy tracks the issue
|
||||
depArgs := []string{"dep", "add", convoyID, beadID, "--type=tracks"}
|
||||
trackBeadID := formatTrackBeadID(beadID)
|
||||
depArgs := []string{"dep", "add", convoyID, trackBeadID, "--type=tracks"}
|
||||
depCmd := exec.Command("bd", depArgs...)
|
||||
depCmd.Dir = townBeads
|
||||
depCmd.Stderr = os.Stderr
|
||||
@@ -1280,10 +1281,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))
|
||||
|
||||
@@ -1401,3 +1402,24 @@ func runBatchSling(beadIDs []string, rigName string, townBeadsDir string) error
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// formatTrackBeadID formats a bead ID for use in convoy tracking dependencies.
|
||||
// Cross-rig beads (non-hq- prefixed) are formatted as external references
|
||||
// so the bd tool can resolve them when running from HQ context.
|
||||
//
|
||||
// Examples:
|
||||
// - "hq-abc123" -> "hq-abc123" (HQ beads unchanged)
|
||||
// - "gt-mol-xyz" -> "external:gt-mol:gt-mol-xyz"
|
||||
// - "beads-task-123" -> "external:beads-task:beads-task-123"
|
||||
func formatTrackBeadID(beadID string) string {
|
||||
if strings.HasPrefix(beadID, "hq-") {
|
||||
return beadID
|
||||
}
|
||||
parts := strings.SplitN(beadID, "-", 3)
|
||||
if len(parts) >= 2 {
|
||||
rigPrefix := parts[0] + "-" + parts[1]
|
||||
return fmt.Sprintf("external:%s:%s", rigPrefix, beadID)
|
||||
}
|
||||
// Fallback for malformed IDs (single segment)
|
||||
return beadID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user