{"record":{"id":"c82cf9117051eef5","repo":"zeroclaw-labs/zeroclaw","slug":"agents-agent-alias-model-provider-resolves-to-a-c82cf9","errorCode":null,"errorMessage":"agents.{agent_alias}.model_provider resolves to a model_provider entry with no `model` set. Configure [providers.models.{provider_name}.<alias>] model = \"...\".","messagePattern":"agents\\.(.+?)\\.model_provider resolves to a model_provider entry with no `model` set\\. Configure \\[providers\\.models\\.(.+?)\\.<alias>\\] model = \"\\.\\.\\.\"\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/agent/loop_.rs","lineNumber":3049,"sourceCode":"        );\n        if count > 0 {\n            ::zeroclaw_log::record!(\n                INFO,\n                ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Register)\n                    .with_category(::zeroclaw_log::EventCategory::Channel)\n                    .with_attrs(::serde_json::json!({\"count\": count})),\n                &format!(\"Registered {} channel(s) for process_message agent\", count),\n            );\n        }\n\n        let model_name = match agent_model_provider\n            .as_ref()\n            .and_then(|e| e.model.as_deref())\n            .map(str::trim)\n            .filter(|m| !m.is_empty())\n        {\n            Some(m) => m.to_string(),\n            None => anyhow::bail!(\n                \"agents.{agent_alias}.model_provider resolves to a model_provider entry with no \\\n             `model` set. Configure [providers.models.{provider_name}.<alias>] model = \\\"...\\\".\"\n            ),\n        };\n        let provider_runtime_options = zeroclaw_providers::provider_runtime_options_for_alias(\n            &config,\n            provider_name,\n            provider_alias.as_str(),\n        );\n        let model_provider: Box<dyn ModelProvider> =\n            zeroclaw_providers::create_routed_model_provider_with_options(\n                &config,\n                &format!(\"{provider_name}.{provider_alias}\"),\n                agent_model_provider\n                    .as_ref()\n                    .and_then(|e| e.api_key.as_deref()),\n                agent_model_provider.as_ref().and_then(|e| e.uri.as_deref()),\n                &config.reliability,","sourceCodeStart":3031,"sourceCodeEnd":3067,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/agent/loop_.rs#L3031-L3067","documentation":"On the process_message path, the agent's model_provider resolved to an entry whose model field is unset or blank after trimming, so no model name could be determined for the turn. Same guard as agent construction (agent.rs), re-enforced at message time to catch post-startup config drift.","triggerScenarios":"A daemon-driven turn uses an agent whose provider table lost its model key after a reload; an entry configured with auth but model left for later; whitespace-only model value.","commonSituations":"Partial config deploys; renaming the model key or commenting it out; multi-layer configs where the layer with the model key is not loaded.","solutions":["Set model = \"<model-id>\" in the named [providers.models.<type>.<alias>] table.","Restart/reload the runtime so the fixed config takes effect.","Add a startup check that every resolved entry has a non-empty model."],"exampleFix":"# before\n[providers.models.openai.main]\napi_key_env = \"OPENAI_API_KEY\"\n# model key absent\n\n# after\n[providers.models.openai.main]\napi_key_env = \"OPENAI_API_KEY\"\nmodel = \"gpt-4o\"","handlingStrategy":"validation","validationCode":"// Before dispatch: resolved entry must name a model\nif let Some((_p, _a, entry)) = config.resolved_model_provider_for_agent(alias) {\n    anyhow::ensure!(\n        entry.model.as_deref().map(str::trim).filter(|m| !m.is_empty()).is_some(),\n        \"agent {alias}: provider entry has no model\"\n    );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set the model key when the provider table is created","Re-run config validation after partial deploys","Restart daemons after fixing the table so the turn path sees the change"],"tags":["config","agents","model","missing-value","gateway"],"backgroundTag":"missing-config-value","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}