{"record":{"id":"d157eb229cd5cf81","repo":"Hmbown/CodeWhale","slug":"selected-fleet-is-missing-or-unreadable-inspect-fleet-and","errorCode":null,"errorMessage":"Selected Fleet is missing or unreadable; inspect /fleet and repair or clear the selection.","messagePattern":"Selected Fleet is missing or unreadable; inspect /fleet and repair or clear the selection\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":8302,"sourceCode":"\n/// Apply the selected v2 Fleet's operator to a fresh root session.\n///\n/// Provider/model are one atomic route: any explicit launch override for\n/// either half keeps the caller's full route and bypasses the saved operator.\n/// Reasoning is independent, so an explicit reasoning flag keeps its value\n/// while the Fleet may still select the provider/model pair. Resumes call\n/// this helper only for fresh sessions and therefore retain their saved route.\nfn apply_selected_fleet_operator_for_launch(\n    config: &mut Config,\n    workspace: &Path,\n    explicit_route_override: bool,\n    explicit_reasoning_override: bool,\n) -> Result<bool> {\n    if explicit_route_override {\n        return Ok(false);\n    }\n    let Some(selected) = crate::fleet::store::resolve_selected_fleet(workspace).map_err(|_| {\n        anyhow!(\n            \"Selected Fleet is missing or unreadable; inspect /fleet and repair or clear the selection.\"\n        )\n    })?\n    else {\n        return Ok(false);\n    };\n    let fleet_name = crate::safe_label::SafeLabel::phrase(&selected.name);\n    let (fleet, _) = crate::fleet::store::load_fleet_at(&selected.path).map_err(|_| {\n        anyhow!(\n            \"selected Fleet '{}' ({}) is invalid or unreadable; inspect /fleet and repair or clear the selection.\",\n            fleet_name,\n            selected.scope.label()\n        )\n    })?;\n    let Some(operator) = fleet.operator.as_ref() else {\n        return Ok(false);\n    };\n    let provider_id = operator.provider.trim();","sourceCodeStart":8284,"sourceCodeEnd":8320,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L8284-L8320","documentation":"Thrown when resolving the user's selected Fleet fails because the Fleet store cannot be read (`resolve_selected_fleet` returns Err). This typically means the selection file exists but is corrupt, unreadable, or points at something broken. The message directs the user to the /fleet command to repair or clear the selection.","triggerScenarios":"Starting a turn with a persisted Fleet selection whose store file cannot be loaded: corrupted JSON, bad permissions, or an IO error reading the selection. Skipped entirely when an explicit route override is active.","commonSituations":"Manually editing the fleet selection file and breaking its format; upgrading versions changed the store schema; file permissions changed after switching users; disk full during a previous write.","solutions":["Run /fleet in the TUI and clear the stale selection, then re-select a valid Fleet.","Inspect the fleet store file for corruption or schema drift and fix or delete it.","Check file permissions on the store location so the current user can read it.","As a workaround, pass an explicit route override for the session, which bypasses Fleet resolution."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match start_turn(...).await {\n    Err(e) if e.to_string().contains(\"Selected Fleet is missing or unreadable\") => {\n        clear_fleet_selection();\n        retry_without_fleet();\n    }\n    other => other,\n}","preventionTips":["Do not hand-edit the fleet selection store; use /fleet.","After upgrades, verify the selection still resolves before starting work.","Keep write-safe disk conditions so store writes are not truncated."],"tags":["fleet","config","corrupt-state"],"backgroundTag":"config-file-not-found","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"}