{"record":{"id":"ceae8b99c143385f","repo":"Hmbown/CodeWhale","slug":"fleet-task-reason-source-source","errorCode":null,"errorMessage":"Fleet task `{}`: {reason} (source={source})","messagePattern":"Fleet task `(.+?)`: (.+?) \\(source=(.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/worker_runtime.rs","lineNumber":304,"sourceCode":"            );\n        }\n        if config.is_none()\n            && let Some(provider_id) = explicit_provider.as_deref()\n            && ApiProvider::parse(provider_id)\n                .is_none_or(|provider| provider == ApiProvider::Custom)\n        {\n            bail!(\n                \"Fleet task `{}` names custom provider=`{provider_id}`, but a provider name alone does not prove its endpoint or model; attach the live route config before creating the run\",\n                task.id,\n            );\n        }\n        if pinned_model && explicit_provider.is_none() {\n            let config = config.expect(\"provider authority checked above\");\n            let (provider, base_url) = (config.api_provider(), config.active_route_base_url());\n            if let Err(reason) =\n                crate::route_runtime::validate_unpinned_model_provider(provider, &model, &base_url)\n            {\n                bail!(\"Fleet task `{}`: {reason} (source={source})\", task.id);\n            }\n        }\n\n        let route = resolve_fleet_route_with_config(task, agent_profiles, session_model, config);\n        let provider = explicit_provider\n            .map(|provider| format!(\"provider=`{provider}`\"))\n            .unwrap_or_else(|| {\n                \"no explicit provider (resolves against the session/default provider)\".to_string()\n            });\n        if route.is_none() {\n            if pinned_model {\n                bail!(\n                    \"Fleet task `{}` pins model `{}` with {} (source={source}), but that route does not \\\n                     resolve to a real model on any configured provider, so the worker cannot launch. \\\n                     The runtime never infers a provider from a model's spelling — set an explicit \\\n                     provider for this model in the profile, or switch the role to `inherit`.\",\n                    task.id,\n                    model,","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/worker_runtime.rs#L286-L322","documentation":"validate_fleet_task_routes fails a Fleet task whose model is explicitly pinned (task.model or agent_profile.model) but whose provider is only implied by the session config. It calls route_runtime::validate_unpinned_model_provider against the active session provider/base_url, and if the pinned model cannot be served by that provider the reason is surfaced as this error. The runtime deliberately never infers a provider from the model name, so a pin that doesn't match the default provider is rejected at run creation instead of failing silently in the worker.","triggerScenarios":"Calling validate_fleet_task_routes where the effective model source is `task.model` or `agent_profile.model`, the agent profile sets no explicit provider, config is present (provider authority exists), and validate_unpinned_model_provider(config.api_provider(), model, config.active_route_base_url()) returns Err — e.g. pinning `deepseek-chat` while the session provider is Anthropic.","commonSituations":"A fleet task pins a model like `gpt-5.6-luna` or a DeepSeek model while the session/default provider is a different vendor; the model's spelling suggests a provider but the config routes to another one. Happens after switching providers mid-session or copying a task spec between machines with different default providers.","solutions":["Set an explicit provider on the agent profile for this task (explicit_fleet_provider_id) so the pin is resolved against that provider, not the session default.","Change the pinned model to one served by the active session provider (or switch the session provider to one carrying the pinned model).","Switch the task's role/model to `inherit` so it resolves within the already-authorized session scope.","Ensure the live route config is attached (config passed to validate_fleet_task_routes) so the validator can check the real base_url."],"exampleFix":"// before\n[worker]\nmodel = \"deepseek-chat\"\n\n// after (profile gains an explicit provider)\n[worker]\nmodel = \"deepseek-chat\"\nprovider = \"deepseek\"","handlingStrategy":"validation","validationCode":"if pinned && profile.provider.is_none() && !session_provider_serves(&model) {\n    return Err(format!(\"pin `{model}` needs an explicit profile provider\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set an explicit provider on profiles that pin a model.","Never rely on model-name spelling to imply a provider.","Keep the session provider and pinned models aligned after provider switches."],"tags":["fleet","model-route","provider-resolution","config"],"backgroundTag":"resource-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"}