{"record":{"id":"77baf898502e3419","repo":"zeroclaw-labs/zeroclaw","slug":"no-model-configured-for-agent-agent-alias-prov","errorCode":null,"errorMessage":"no model configured for agent {agent_alias}: [providers.models.{provider_name}.<alias>].model is unset and --model was not passed","messagePattern":"no model configured for agent (.+?): \\[providers\\.models\\.(.+?)\\.<alias>\\]\\.model is unset and --model was not passed","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/agent/loop_.rs","lineNumber":1463,"sourceCode":"                        .with_category(::zeroclaw_log::EventCategory::Agent)\n                        .with_outcome(::zeroclaw_log::EventOutcome::Failure)\n                        .with_attrs(::serde_json::json!({\"agent_alias\": agent_alias})),\n                    \"agent loop refused: agent.model_provider unresolved and no --provider override\"\n                );\n                anyhow::Error::msg(format!(\n                    \"agents.{agent_alias}.model_provider does not resolve and no provider override \\\n                     was passed on the CLI. Either set `[agents.{agent_alias}] model_provider` or \\\n                     pass --provider.\"\n                ))\n            })?\n            .to_string();\n\n        let mut model_name = match model_override\n            .as_deref()\n            .or(agent_model_provider.and_then(|e| e.model.as_deref()))\n        {\n            Some(m) => m.to_string(),\n            None => anyhow::bail!(\n                \"no model configured for agent {agent_alias}: \\\n             [providers.models.{provider_name}.<alias>].model is unset and --model was not passed\"\n            ),\n        };\n\n        {\n            let span = zeroclaw_log::Span::current();\n            let mp_composite = match agent_provider_resolved.as_ref() {\n                Some((ty, alias, _)) => format!(\"{ty}.{alias}\"),\n                None => provider_name.clone(),\n            };\n            span.record(\"model_provider\", mp_composite.as_str());\n            span.record(\"model\", model_name.as_str());\n        }\n\n        let agent_runtime_options = match agent_provider_resolved.as_ref() {\n            Some((ty, alias, _)) => {\n                zeroclaw_providers::provider_runtime_options_for_alias(&config, ty, alias)","sourceCodeStart":1445,"sourceCodeEnd":1481,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/agent/loop_.rs#L1445-L1481","documentation":"In the interactive agent run path, neither the [providers.models.<type>.<alias>].model value nor a --model CLI override produced a model name, so the loop refuses to start. The error is explicit that both sources were checked — set one of them. It differs from the construction-time variant by accepting a CLI rescue.","triggerScenarios":"Running the agent loop with a provider entry whose model key is unset while omitting --model; a wrapper script that drops the --model argument it was supposed to forward.","commonSituations":"Testing a freshly added provider entry before choosing a model; scripts that conditionally pass --model and hit the unset branch; config overlays removing the model key.","solutions":["Pass --model <model-id> on the command line for an immediate unblock.","Or set model = \"<model-id>\" in the referenced [providers.models.<type>.<alias>] table.","If a wrapper was supposed to supply --model, check it forwards arguments correctly."],"exampleFix":"# before\nzeroclaw agent run\n# config entry has no model key\n\n# after (either fix works)\nzeroclaw agent run --model claude-sonnet-4-5\n# or in config:\n# [providers.models.anthropic.default]\n# model = \"claude-sonnet-4-5\"","handlingStrategy":"validation","validationCode":"// Guard scripts that run on partially configured agents\nlet model = cfg_model\n    .map(str::trim)\n    .filter(|m| !m.is_empty())\n    .or(cli.model.as_deref());\nanyhow::ensure!(model.is_some(), \"set providers.models.*.model or pass --model\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass --model explicitly in scripts that run newly added agents","Check wrapper scripts forward all arguments","Fail CI when an agent under test has no model configured"],"tags":["config","agents","model","cli","missing-value"],"backgroundTag":"missing-config-value","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}