{"record":{"id":"e9ddc5c0aaa91b93","repo":"zeroclaw-labs/zeroclaw","slug":"max-depth-must-be-greater-than-0","errorCode":null,"errorMessage":"'max_depth' must be greater than 0","messagePattern":"'max_depth' must be greater than 0","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-tools/src/model_routing_config.rs","lineNumber":966,"sourceCode":"        }\n\n        // synthesize runtime_profiles[name] from agentic/max_iterations/max_depth.\n        {\n            let runtime = cfg.runtime_profiles.entry(name.clone()).or_default();\n            if let Some(agentic) = agentic_update {\n                runtime.agentic = agentic;\n            }\n            if let MaybeSet::Set(iters) = max_iterations_update {\n                if iters == 0 {\n                    anyhow::bail!(\"'max_iterations' must be greater than 0\");\n                }\n                runtime.max_tool_iterations = iters;\n            } else if runtime.max_tool_iterations == 0 {\n                runtime.max_tool_iterations = DEFAULT_AGENT_MAX_ITERATIONS;\n            }\n            if let MaybeSet::Set(depth) = max_depth_update {\n                if depth == 0 {\n                    anyhow::bail!(\"'max_depth' must be greater than 0\");\n                }\n                runtime.max_delegation_depth = depth;\n            } else if runtime.max_delegation_depth == 0 {\n                runtime.max_delegation_depth = DEFAULT_AGENT_MAX_DEPTH;\n            }\n        }\n\n        // Get or create the agent and wire up alias references.\n        let next_agent = cfg.agents.entry(name.clone()).or_default();\n        next_agent.model_provider = agent_model_provider_ref.into();\n        next_agent.risk_profile = name.clone().into();\n        next_agent.runtime_profile = name.clone().into();\n        if let Some(same_profile) = delegate_same_risk_profile_update {\n            next_agent.delegate_same_risk_profile = same_profile;\n        }\n        if let Some(delegates) = delegates_update {\n            next_agent.delegates = delegates;\n        }","sourceCodeStart":948,"sourceCodeEnd":984,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-tools/src/model_routing_config.rs#L948-L984","documentation":"Error \"'max_depth' must be greater than 0\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-tools/src/model_routing_config.rs:966 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set max_depth to a value greater than 0."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}