{"record":{"id":"4c61d68b3f755aed","repo":"Hmbown/CodeWhale","slug":"cannot-create-fleet-run-error","errorCode":null,"errorMessage":"cannot create Fleet run: {error}","messagePattern":"cannot create Fleet run: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/manager.rs","lineNumber":374,"sourceCode":"        max_workers: usize,\n    ) -> Result<FleetRunReport> {\n        self.create_queued_run_with_descriptor(\n            doc,\n            max_workers,\n            ManagedFleetRunDescriptor::default(),\n        )\n    }\n\n    pub fn create_queued_run_with_descriptor(\n        &self,\n        mut doc: FleetTaskSpecDocument,\n        max_workers: usize,\n        descriptor: ManagedFleetRunDescriptor,\n    ) -> Result<FleetRunReport> {\n        validate_task_spec_document(&doc)?;\n        let roster = self.agent_roster();\n        if let Some(error) = roster.load_error() {\n            bail!(\"cannot create Fleet run: {error}\");\n        }\n        for task in &doc.tasks {\n            if let Some(worker) = &task.worker\n                && let Some(selector) = worker.agent_profile.as_deref().or(worker.role.as_deref())\n            {\n                roster.resolve_member(selector)?;\n            }\n        }\n        worker_runtime::freeze_fleet_task_members(\n            &mut doc.tasks,\n            roster.members(),\n            roster.is_exact_selection(),\n        )?;\n        worker_runtime::validate_task_agent_profiles(&doc.tasks, roster.members())?;\n        worker_runtime::validate_fleet_task_routes(\n            &doc.tasks,\n            roster.members(),\n            self.session_model(),","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/manager.rs#L356-L392","documentation":"FleetManager::create_queued_run_with_descriptor refuses to create a Fleet run when the agent roster failed to load (crates/tui/src/fleet/manager.rs:374). The roster defines which agent profiles/roles tasks may select; if its source has a load error, member resolution and profile freezing cannot proceed, so the run is rejected up front rather than failing mid-dispatch. The underlying roster load error is embedded in the message.","triggerScenarios":"Calling create_queued_run / create_queued_run_with_descriptor while the agent roster's backing files are missing, unreadable, or malformed, so roster.load_error() returns Some — e.g. a broken agents directory, bad YAML/frontmatter in a profile definition, or permission problems.","commonSituations":"A user edited or deleted agent profile files referenced by the task spec's agent_profile/role selectors; a misconfigured agents path in settings; a partially-written roster file after an interrupted sync or version upgrade.","solutions":["Read the embedded {error} in the message and fix the underlying roster load problem (repair or restore the agent profile source files).","Validate that all agent_profile/role selectors in the task spec exist in the roster before dispatching.","Re-run after fixing config so roster.load_error() returns None."],"exampleFix":"// before\n// agents dir missing a profile referenced by task.worker.agent_profile\nlet report = manager.create_queued_run_with_descriptor(doc, 4, descriptor)?;\n// after\n// restore/repair the profile file (e.g. .agents/reviewer.md) or drop the selector, then retry\nlet report = manager.create_queued_run_with_descriptor(doc, 4, descriptor)?;","handlingStrategy":"validation","validationCode":"if let Some(err) = manager.agent_roster().load_error() {\n    return Err(anyhow!(\"roster unavailable: {err}\")); // fix roster files before creating runs\n}","typeGuard":null,"tryCatchPattern":"match manager.create_queued_run_with_descriptor(doc, max, desc) {\n    Ok(report) => report,\n    Err(e) if e.to_string().starts_with(\"cannot create Fleet run\") => { /* surface embedded roster error to the user */ }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Check agent_roster().load_error() as a startup health check before allowing dispatch.","Keep agent profile files under version control and validate them on edit.","Verify every agent_profile/role selector in a task spec resolves in the roster before saving the spec."],"tags":["fleet","config","roster"],"backgroundTag":"missing-required-config","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"}