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

plugins.entries[ ].name must not have leading or trailing…

Error message

plugins.entries[{index}].name must not have leading or trailing whitespace

What it means

Validation guard in validate_plugin_entries: the entry name differs from its trimmed form, i.e. it carries leading or trailing whitespace. Such names silently break exact-match lookups against the same key written trimmed, so config load rejects it and names the index.

Solutions

  1. Remove leading and trailing whitespace from the plugin entry name in config.toml.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/zeroclaw-config/src/schema.rs:10059 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/7fb1047235b2d307. Report an issue: GitHub.

Appendix: source

Thrown at crates/zeroclaw-config/src/schema.rs:10059

            && service_key
                .strip_prefix(prefix)
                .is_some_and(|suffix| suffix.starts_with('.'));
    }

    false
}

const MCP_MAX_TOOL_TIMEOUT_SECS: u64 = 600;

fn validate_plugin_entries(config: &PluginsConfig) -> Result<()> {
    let mut seen = std::collections::HashSet::new();
    for (index, entry) in config.entries.iter().enumerate() {
        let instance_key = entry.name.trim();
        if instance_key.is_empty() {
            anyhow::bail!("plugins.entries[{index}].name must not be empty");
        }
        if instance_key != entry.name {
            anyhow::bail!(
                "plugins.entries[{index}].name must not have leading or trailing whitespace"
            );
        }
        if !seen.insert(instance_key) {
            anyhow::bail!("plugins.entries contains a duplicate instance key");
        }
    }
    Ok(())
}

fn validate_mcp_config(config: &McpConfig) -> Result<()> {
    let mut seen_names = std::collections::HashSet::new();
    for (i, server) in config.servers.iter().enumerate() {
        let name = server.name.trim();
        if name.is_empty() {
            validation_bail!(
                RequiredFieldEmpty,
                format!("mcp.servers[{i}].name"),

View on GitHub (pinned to 88bb9c8533)