feat(sling): implement --convoy flag logic (gt-9o4)
Add --convoy flag to gt sling that allows adding an issue to an existing convoy instead of creating a new one. When specified: - Validates the convoy exists and is open - Adds tracking relation between convoy and issue - Skips auto-convoy creation Changes: - Add slingConvoy variable and --convoy flag registration - Add addToExistingConvoy() helper function in sling_convoy.go - Modify auto-convoy logic to check slingConvoy first Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -114,9 +114,9 @@ func init() {
|
||||
slingCmd.Flags().StringVar(&slingAccount, "account", "", "Claude Code account handle to use")
|
||||
slingCmd.Flags().StringVar(&slingAgent, "agent", "", "Override agent/runtime for this sling (e.g., claude, gemini, codex, or custom alias)")
|
||||
slingCmd.Flags().BoolVar(&slingNoConvoy, "no-convoy", false, "Skip auto-convoy creation for single-issue sling")
|
||||
slingCmd.Flags().BoolVar(&slingHookRawBead, "hook-raw-bead", false, "Hook raw bead without default formula (expert mode)")
|
||||
slingCmd.Flags().StringVar(&slingEpic, "epic", "", "Link auto-created convoy to parent epic")
|
||||
slingCmd.Flags().StringVar(&slingConvoy, "convoy", "", "Add to existing convoy instead of creating new")
|
||||
slingCmd.Flags().BoolVar(&slingHookRawBead, "hook-raw-bead", false, "Hook raw bead without default formula (expert mode)")
|
||||
|
||||
rootCmd.AddCommand(slingCmd)
|
||||
}
|
||||
@@ -380,9 +380,21 @@ func runSling(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-convoy: check if issue is already tracked by a convoy
|
||||
// If not, create one for dashboard visibility (unless --no-convoy is set)
|
||||
if !slingNoConvoy && formulaName == "" {
|
||||
// Convoy handling: --convoy adds to existing, otherwise auto-create (unless --no-convoy)
|
||||
if slingConvoy != "" {
|
||||
// Use existing convoy specified by --convoy flag
|
||||
if slingDryRun {
|
||||
fmt.Printf("Would add to convoy %s\n", slingConvoy)
|
||||
fmt.Printf("Would add tracking relation to %s\n", beadID)
|
||||
} else {
|
||||
if err := addToExistingConvoy(slingConvoy, beadID); err != nil {
|
||||
return fmt.Errorf("adding to convoy: %w", err)
|
||||
}
|
||||
fmt.Printf("%s Added to convoy %s\n", style.Bold.Render("→"), slingConvoy)
|
||||
}
|
||||
} else if !slingNoConvoy && formulaName == "" {
|
||||
// Auto-convoy: check if issue is already tracked by a convoy
|
||||
// If not, create one for dashboard visibility
|
||||
existingConvoy := isTrackedByConvoy(beadID)
|
||||
if existingConvoy == "" {
|
||||
if slingDryRun {
|
||||
|
||||
Reference in New Issue
Block a user