{"record":{"id":"2dcb7bc2ec879b8e","repo":"Hmbown/CodeWhale","slug":"fleet-run-does-not-exist","errorCode":null,"errorMessage":"fleet run {} does not exist","messagePattern":"fleet run (.+?) does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/manager.rs","lineNumber":1223,"sourceCode":"                continue;\n            }\n            affected_runs.insert(task.entry.run_id.0.clone());\n            stopped += 1;\n        }\n        for run_id in affected_runs {\n            self.ledger.update_run_status(\n                &FleetRunId::from(run_id),\n                FleetRunStatus::Cancelled,\n                &timestamp(),\n            )?;\n        }\n        Ok(stopped)\n    }\n\n    pub fn stop_run(&self, run_id: &FleetRunId) -> Result<usize> {\n        let state = self.ledger.rebuild_state()?;\n        if !state.runs.contains_key(&run_id.0) {\n            bail!(\"fleet run {} does not exist\", run_id.0);\n        }\n        let now = timestamp();\n        let mut stopped = 0usize;\n        for task in state\n            .tasks\n            .values()\n            .filter(|task| task.entry.run_id == *run_id)\n        {\n            if !matches!(\n                task.status,\n                FleetTaskLedgerStatus::Enqueued | FleetTaskLedgerStatus::Leased\n            ) {\n                continue;\n            }\n            if !self.ledger.cancel_task_if_active(\n                &task.entry.run_id,\n                &task.entry.task_id,\n                None,","sourceCodeStart":1205,"sourceCodeEnd":1241,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/fleet/manager.rs#L1205-L1241","documentation":"FleetManager::stop_run rebuilds ledger state and looks up the requested run id; this error means the id is absent from the ledger, so there is nothing to stop — typically a stale run id from a finished or already-cancelled run, or a typo.","triggerScenarios":"Calling stop_run with a mistyped or truncated run id, an id from a different state directory, or before the run's creation event was persisted.","commonSituations":"Stopping a run by a display-truncated id copied from the UI; shell history reuse after switching projects/state dirs; racing run creation.","solutions":["List runs from the same manager to copy the exact run id","Verify the state/run directory the manager was constructed with","If the run was just created, wait for its creation to be durably appended before issuing control commands"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify the run exists before controlling it\nlet exists = manager\n    .run_status(&run_id)\n    .map(|_| true)\n    .unwrap_or(false);\nassert!(exists, \"unknown fleet run id\");","typeGuard":null,"tryCatchPattern":"match manager.stop_run(&run_id) {\n    Ok(n) => Ok(n),\n    Err(err) if err.to_string().contains(\"does not exist\") => Ok(0), // already gone; idempotent\n    Err(err) => Err(err),\n}","preventionTips":["Pass full run ids programmatically instead of retyping truncated display ids","Treat stop-on-missing-run as success in cleanup scripts"],"tags":["fleet","run-not-found","rust","codewhale"],"backgroundTag":"entity-not-found","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}