fix(doctor): require --restart-sessions flag to cycle patrol sessions (gt-j44ri)
Previously `gt doctor --fix` would automatically kill and restart patrol sessions when fixing stale settings.json files. This was disruptive as it interrupted work without explicit consent. Now session cycling only happens when `--restart-sessions` is explicitly passed along with `--fix`. Without the flag, settings files are updated but running sessions are left alone. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,9 +10,10 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
doctorFix bool
|
||||
doctorVerbose bool
|
||||
doctorRig string
|
||||
doctorFix bool
|
||||
doctorVerbose bool
|
||||
doctorRig string
|
||||
doctorRestartSessions bool
|
||||
)
|
||||
|
||||
var doctorCmd = &cobra.Command{
|
||||
@@ -82,6 +83,7 @@ func init() {
|
||||
doctorCmd.Flags().BoolVar(&doctorFix, "fix", false, "Attempt to automatically fix issues")
|
||||
doctorCmd.Flags().BoolVarP(&doctorVerbose, "verbose", "v", false, "Show detailed output")
|
||||
doctorCmd.Flags().StringVar(&doctorRig, "rig", "", "Check specific rig only")
|
||||
doctorCmd.Flags().BoolVar(&doctorRestartSessions, "restart-sessions", false, "Restart patrol sessions when fixing stale settings (use with --fix)")
|
||||
rootCmd.AddCommand(doctorCmd)
|
||||
}
|
||||
|
||||
@@ -94,9 +96,10 @@ func runDoctor(cmd *cobra.Command, args []string) error {
|
||||
|
||||
// Create check context
|
||||
ctx := &doctor.CheckContext{
|
||||
TownRoot: townRoot,
|
||||
RigName: doctorRig,
|
||||
Verbose: doctorVerbose,
|
||||
TownRoot: townRoot,
|
||||
RigName: doctorRig,
|
||||
Verbose: doctorVerbose,
|
||||
RestartSessions: doctorRestartSessions,
|
||||
}
|
||||
|
||||
// Create doctor and register checks
|
||||
|
||||
Reference in New Issue
Block a user