{"record":{"id":"5a4178a2f8d1aea3","repo":"zeroclaw-labs/zeroclaw","slug":"agents-agent-alias-model-provider-is-empty-set","errorCode":null,"errorMessage":"agents.{agent_alias}.model_provider is empty — set it to a configured \"<type>.<alias>\" (e.g. \"anthropic.{agent_alias}\")","messagePattern":"agents\\.(.+?)\\.model_provider is empty — set it to a configured \"<type>\\.<alias>\" \\(e\\.g\\. \"anthropic\\.(.+?)\"\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/agent/agent.rs","lineNumber":1573,"sourceCode":"                policy.allowed_roots.push(agent_workspace.clone());\n            }\n            policy\n        });\n\n        let (provider_name, provider_alias, agent_model_provider) =\n            match config.resolved_model_provider_for_agent(agent_alias) {\n                Some(resolved) => (resolved.0, resolved.1, Some(resolved.2)),\n                None => {\n                    let agent_ref = agent_cfg.model_provider.as_str();\n                    if !agent_ref.is_empty() {\n                        anyhow::bail!(\n                            \"agents.{agent_alias}.model_provider = \\\"{agent_ref}\\\" does not \\\n                             resolve to a configured [providers.models.<type>.<alias>] entry\"\n                        );\n                    }\n                    // V3 schema requires every agent to set model_provider.\n                    // Empty is a config error rather than a silent fallback.\n                    anyhow::bail!(\n                        \"agents.{agent_alias}.model_provider is empty — set it to a \\\n                         configured \\\"<type>.<alias>\\\" (e.g. \\\"anthropic.{agent_alias}\\\")\"\n                    );\n                }\n            };\n        let memory: Arc<dyn Memory> = zeroclaw_memory::create_memory_for_agent(\n            config,\n            agent_alias,\n            agent_model_provider.and_then(|e| e.api_key.as_deref()),\n        )\n        .await?;\n\n        let composio_key = if config.composio.enabled {\n            config.composio.api_key.as_deref()\n        } else {\n            None\n        };\n        let composio_entity_id = if config.composio.enabled {","sourceCodeStart":1555,"sourceCodeEnd":1591,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/agent/agent.rs#L1555-L1591","documentation":"The V3 schema requires every agent to declare model_provider explicitly; when the field is an empty string, agent construction fails with this error instead of silently picking a default. The message suggests the conventional form \"anthropic.<agent_alias>\" as a starting point.","triggerScenarios":"agents.<alias>.model_provider = \"\" in the TOML; a new agent table added without the model_provider key resolving to empty; a template with an unfilled placeholder.","commonSituations":"Hand-adding an agent block and forgetting the provider line; provisioning scripts emitting empty fields; migrating configs where the field used to be optional.","solutions":["Set agents.<alias>.model_provider to a configured \"<type>.<alias>\" such as \"anthropic.default\".","Ensure the referenced [providers.models.<type>.<alias>] table exists and sets a model.","Add a config lint step that rejects empty model_provider values before deploy."],"exampleFix":"# before\n[agents.helper]\nmodel_provider = \"\"\n\n# after\n[agents.helper]\nmodel_provider = \"anthropic.default\"","handlingStrategy":"validation","validationCode":"// Startup lint: no empty model_provider\nfor (alias, agent) in &config.agents {\n    anyhow::ensure!(\n        !agent.model_provider.as_str().trim().is_empty(),\n        \"agents.{alias}.model_provider is empty\"\n    );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add model_provider to the agent table template your provisioning uses","Reject empty-string fields in config linting rather than defaulting them","Write one working agent block and copy it as the canonical example"],"tags":["config","agents","model-provider","validation","missing-value"],"backgroundTag":"missing-config-value","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}