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

'{field}' must be a string, string[], or delegate target obj

Error message

'{field}' must be a string, string[], or delegate target object[]

What it means

Error "'{field}' must be a string, string[], or delegate target object[]" thrown in zeroclaw-labs/zeroclaw.

Source

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

                            .with_attrs(::serde_json::json!({
                                "field": field,
                                "error": format!("{}", error),
                            })),
                            "model_routing_config: delegate target element has invalid shape"
                        );
                        anyhow::Error::msg(format!(
                            "'{field}' array must contain strings or objects with agent/mode: {error}"
                        ))
                    })?;
                target.agent = target.agent.trim().to_string();
                if !target.agent.is_empty() {
                    out.push(target);
                }
            }
            return Ok(out);
        }

        anyhow::bail!("'{field}' must be a string, string[], or delegate target object[]")
    }

    fn parse_non_empty_string(args: &Value, field: &str) -> anyhow::Result<String> {
        let value = args
            .get(field)
            .and_then(Value::as_str)
            .ok_or_else(|| {
                ::zeroclaw_log::record!(
                    WARN,
                    ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Reject)
                        .with_outcome(::zeroclaw_log::EventOutcome::Failure)
                        .with_attrs(::serde_json::json!({"param": field})),
                    "model_routing_config: missing required string param"
                );
                anyhow::Error::msg(format!("Missing '{field}'"))
            })?
            .trim();

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Provide the field as a string, string[], or an array of delegate target objects.

When it happens

Trigger: Thrown at crates/zeroclaw-tools/src/model_routing_config.rs:166 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/7e258ef30d3f52e1. Report an issue: GitHub.