zeroclaw-labs/zeroclaw · error · anyhow::Error

'max_iterations' must be greater than 0

Error message

'max_iterations' must be greater than 0

What it means

Error "'max_iterations' must be greater than 0" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-tools/src/model_routing_config.rs:958

        }

        // synthesize risk_profiles[name] from allowed_tools (authorization).
        {
            let risk = cfg.risk_profiles.entry(name.clone()).or_default();
            if let Some(tools) = allowed_tools_update {
                risk.allowed_tools = tools;
            }
        }

        // synthesize runtime_profiles[name] from agentic/max_iterations/max_depth.
        {
            let runtime = cfg.runtime_profiles.entry(name.clone()).or_default();
            if let Some(agentic) = agentic_update {
                runtime.agentic = agentic;
            }
            if let MaybeSet::Set(iters) = max_iterations_update {
                if iters == 0 {
                    anyhow::bail!("'max_iterations' must be greater than 0");
                }
                runtime.max_tool_iterations = iters;
            } else if runtime.max_tool_iterations == 0 {
                runtime.max_tool_iterations = DEFAULT_AGENT_MAX_ITERATIONS;
            }
            if let MaybeSet::Set(depth) = max_depth_update {
                if depth == 0 {
                    anyhow::bail!("'max_depth' must be greater than 0");
                }
                runtime.max_delegation_depth = depth;
            } else if runtime.max_delegation_depth == 0 {
                runtime.max_delegation_depth = DEFAULT_AGENT_MAX_DEPTH;
            }
        }

        // Get or create the agent and wire up alias references.
        let next_agent = cfg.agents.entry(name.clone()).or_default();
        next_agent.model_provider = agent_model_provider_ref.into();

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Set max_iterations to a value greater than 0.

When it happens

Trigger: Thrown at crates/zeroclaw-tools/src/model_routing_config.rs:958 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/ec85d101c81ad157. Report an issue: GitHub.