{"record":{"id":"61aef5edc063fbf2","repo":"Hmbown/CodeWhale","slug":"worker-worker-id-has-no-fleet-task-to-restart-manager","errorCode":null,"errorMessage":"worker {worker_id} has no Fleet task to restart","messagePattern":"worker (.+?) has no Fleet task to restart","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/manager.rs","lineNumber":1068,"sourceCode":"            &task.entry.task_id,\n            Some(worker_id),\n            &timestamp(),\n            Some(\"operator\"),\n            Some(\"operator\"),\n        )?;\n        if !cancelled {\n            bail!(\"worker {worker_id} no longer has that running Fleet task\");\n        }\n        self.refresh_run_status(&task.entry.run_id)?;\n        self.inspect_worker(worker_id)\n    }\n\n    pub fn restart_worker(&self, worker_id: &str) -> Result<FleetRestartReport> {\n        let state = self.ledger.rebuild_state()?;\n        let Some(task) = active_task_for_worker(&state, worker_id)\n            .or_else(|| latest_task_for_worker(&state, worker_id))\n        else {\n            bail!(\"worker {worker_id} has no Fleet task to restart\");\n        };\n        let run = state\n            .runs\n            .get(&task.entry.run_id.0)\n            .ok_or_else(|| anyhow!(\"Fleet run {} does not exist\", task.entry.run_id.0))?;\n        let max_workers = run\n            .max_workers\n            .unwrap_or_else(|| run.worker_specs.len().max(1))\n            .clamp(1, 128);\n        let mut coordination_guard = match &self.sub_agent_manager {\n            Some(manager) => {\n                let Ok(guard) = manager.try_write() else {\n                    bail!(\"Fleet worker {worker_id} coordination state is busy; retry restart\");\n                };\n                Some(guard)\n            }\n            None => None,\n        };","sourceCodeStart":1050,"sourceCodeEnd":1086,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/manager.rs#L1050-L1086","documentation":"Restart guard in Fleet restart_worker: neither the rebuilt ledger state nor the late-arrival lookup finds any task entry for the worker, so there is nothing to restart. The worker id names a worker with no Fleet task history in this run.","triggerScenarios":"Thrown at crates/tui/src/fleet/manager.rs:1068 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the worker_id against the run's task list (inspect_worker / run state) before restarting.","Start a new Fleet task for the worker if the old one was already cleaned up."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}