fix(crew): add dry-run support and error handling to crew stop (gt-kjcx4)

Fixed two issues in `gt crew stop <name>`:

1. --dry-run flag now works for individual crew stops (previously only
   worked with --all)

2. HasSession errors are now properly handled instead of being ignored,
   which could cause "No session found" messages even when sessions exist

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/max
2026-01-06 13:24:54 -08:00
committed by Steve Yegge
parent a3bccc881b
commit a787d60add

View File

@@ -666,12 +666,23 @@ func runCrewStop(cmd *cobra.Command, args []string) error {
sessionID := crewSessionName(r.Name, name)
// Check if session exists
hasSession, _ := t.HasSession(sessionID)
hasSession, err := t.HasSession(sessionID)
if err != nil {
fmt.Printf("Error checking session %s: %v\n", sessionID, err)
lastErr = err
continue
}
if !hasSession {
fmt.Printf("No session found for %s/%s\n", r.Name, name)
continue
}
// Dry run - just show what would be stopped
if crewDryRun {
fmt.Printf("Would stop %s/%s (session: %s)\n", r.Name, name, sessionID)
continue
}
// Capture output before stopping (best effort)
var output string
if !crewForce {