{"record":{"id":"ef80eb835f71ad93","repo":"zeroclaw-labs/zeroclaw","slug":"agent-name-uses-invalid-model-provider-provi","errorCode":null,"errorMessage":"agent \"{name}\" uses invalid model_provider \"{provider_ref}\": {reason}","messagePattern":"agent \"(.+?)\" uses invalid model_provider \"(.+?)\": (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-runtime/src/doctor/mod.rs","lineNumber":1368,"sourceCode":"                cat,\n                format!(\n                    \"channels.discord.{alias}.bot_token is unset but the channel is enabled — the channel cannot connect until a bot token is set\"\n                ),\n            ));\n        }\n    }\n\n    // Delegate agents: model_provider validity (resolved from model_provider alias)\n    let mut agent_names: Vec<_> = config.agents.keys().collect();\n    agent_names.sort();\n    for name in agent_names {\n        let agent = config.agents.get(name).unwrap();\n        let provider_ref = agent.model_provider.as_str();\n        if provider_ref.is_empty() {\n            continue;\n        }\n        if let Some(reason) = provider_validation_error(config, provider_ref) {\n            items.push(DiagItem::warn(\n                cat,\n                format!(\n                    \"agent \\\"{name}\\\" uses invalid model_provider \\\"{provider_ref}\\\": {reason}\",\n                ),\n            ));\n        }\n    }\n\n    // Non-fatal config warnings — dangling fallback refs, wire_api misuse, etc.\n    // Source of truth: `Config::collect_warnings()` (same signal as gateway API\n    // and `Config::validate()` tracing). Do not duplicate checks here.\n    for warning in config.collect_warnings() {\n        items.push(DiagItem::warn(\n            cat,\n            format!(\"{} (at {})\", warning.message, warning.path),\n        ));\n    }\n}","sourceCodeStart":1350,"sourceCodeEnd":1386,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/doctor/mod.rs#L1350-L1386","documentation":"check_config_semantics applies the same provider-resolution check to every agent's `model_provider`. Empty refs are skipped; a non-empty ref that fails `create_doctor_model_provider` produces this warning with the underlying reason. Model calls through that agent will fail at request time until the reference is fixed.","triggerScenarios":"An `[agents.<name>]` entry points at a provider name that does not exist in the providers table, or at a slot whose settings are invalid; `zeroclaw doctor` names the agent, the ref, and the reason.","commonSituations":"Renaming a provider without updating agent definitions; deleting a provider slot an agent still uses; onboarded agents from a template referencing provider keys that were never created.","solutions":["Set the agent's `model_provider` to a defined, valid provider key","Re-add or repair the provider slot the agent depends on","Re-run `zeroclaw doctor` until agents report no provider warnings"],"exampleFix":"# before\n[agents.writer]\nmodel_provider = \"gpt4\"      # typo, no such provider\n\n# after\n[agents.writer]\nmodel_provider = \"openai\"    # defined under [providers.openai]","handlingStrategy":"validation","validationCode":"let out = std::process::Command::new(\"zeroclaw\")\n    .args([\"doctor\"])\n    .output()?;\nlet text = String::from_utf8_lossy(&out.stdout);\nif text.contains(\"uses invalid model_provider\") {\n    return Err(anyhow::anyhow!(\"agent model_provider refs are broken; fix before deploy\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add or rename agents together with the provider entries they reference","Gate deploys on a clean `zeroclaw doctor` run"],"tags":["zeroclaw","doctor","config","agents","provider"],"backgroundTag":"unknown-model-provider","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}