{"record":{"id":"2fa4c2d7965ac4a9","repo":"Hmbown/CodeWhale","slug":"pass-all-to-stop-all-fleet-work","errorCode":null,"errorMessage":"pass --all to stop all fleet work","messagePattern":"pass --all to stop all fleet work","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":3161,"sourceCode":"            Ok(())\n        }\n        FleetCommand::Resume {\n            run_id,\n            stale_after_seconds,\n        } => {\n            let manager = manager.with_stale_after(Duration::from_secs(stale_after_seconds.max(1)));\n            emit_fleet_receipt(&fleet_control::execute_fleet_control_with(\n                ControlSurface::Cli,\n                workspace,\n                fleet_context,\n                &manager,\n                ControlOperation::FleetResume,\n                Some(&run_id),\n            ))\n        }\n        FleetCommand::Stop { all } => {\n            if !all {\n                bail!(\"pass --all to stop all fleet work\");\n            }\n            let stopped = manager.stop_all()?;\n            println!(\"stopped: {stopped}\");\n            Ok(())\n        }\n        FleetCommand::AlertDryRun(args) => {\n            let class = alert_event_class(args.event);\n            let adapter = alert_adapter(&args);\n            let event = FleetAlertEvent {\n                class,\n                run_id: FleetRunId::from(args.run_id.clone()),\n                worker_id: args.worker_id.clone(),\n                task_id: args.task_id.clone(),\n                status: alert_status(class, args.status.clone()),\n                reason: args.reason.clone(),\n            };\n            let dispatcher = FleetAlertDispatcher::new(\n                FleetAlertConfig::dry_run_for_adapter(adapter),","sourceCodeStart":3143,"sourceCodeEnd":3179,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/lib.rs#L3143-L3179","documentation":"Guard inside the `fleet stop` subcommand (FleetCommand::Stop). Stopping is fleet-wide: it calls manager.stop_all() and kills work for every run, so the CLI refuses a bare `codewhale fleet stop` unless the explicit `--all` acknowledgement flag is passed. Nothing has been stopped when this fires; it is a pure usage guard, not a runtime failure.","triggerScenarios":"Executing `codewhale fleet stop` without `--all` (FleetCommand::Stop { all: false }). Per-run operations exist elsewhere (e.g. FleetResume takes a run_id), so users often assume stop also accepts a run id — it does not.","commonSituations":"Muscle memory from per-run fleet commands (resume with a run id); copy-pasted scripts written before the confirmation flag was added; CI cleanup jobs that call bare `fleet stop`.","solutions":["Re-run as `codewhale fleet stop --all` when you really mean to stop all fleet work","To affect a single run, use the run-id-scoped fleet controls rather than stop — stop is deliberately fleet-wide","Update scripts and docs to always carry `--all` so intent is explicit"],"exampleFix":"// before\n$ codewhale fleet stop\nError: pass --all to stop all fleet work\n\n// after\n$ codewhale fleet stop --all\nstopped: 3","handlingStrategy":"validation","validationCode":"# wrapper: refuse a bare `fleet stop` before codewhale ever runs\nif [ \"$1\" = fleet ] && [ \"$2\" = stop ]; then\n  case \" $3 $4 $5 \" in *' --all '*) ;; *) echo 'refusing: fleet stop requires --all' >&2; exit 2;; esac\nfi\nexec codewhale \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat fleet stop as a fleet-wide kill switch and always spell out --all","Never auto-retry a failed fleet stop by silently adding --all; make that escalation a human decision","Use the run-id-scoped commands when you only want to touch one run"],"tags":["fleet","cli","flag-guard","destructive-operation"],"backgroundTag":"confirmation-flag-required","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}