zeroclaw-labs/zeroclaw · error

google_workspace.allowed_operations[{i}].methods[{j}] contai

Error message

google_workspace.allowed_operations[{i}].methods[{j}] contains invalid characters: {normalized}

What it means

Config::validate() restricts each allowed_operations[].methods element to ASCII alphanumerics (camelCase allowed), '_' and '-' after trimming. Method names like quickAdd or batchUpdate are camelCase in the Google APIs, so uppercase is accepted, but dots, slashes, spaces and other punctuation are rejected because they cannot appear in the runtime tool identifiers the allowlist matches.

Source

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

                    RequiredFieldEmpty,
                    format!("google_workspace.allowed_operations[{i}].methods"),
                    "google_workspace.allowed_operations[{i}].methods must not be empty"
                );
            }

            let mut seen_methods = std::collections::HashSet::new();
            for (j, method) in operation.methods.iter().enumerate() {
                let normalized = method.trim();
                if normalized.is_empty() {
                    anyhow::bail!(
                        "google_workspace.allowed_operations[{i}].methods[{j}] must not be empty"
                    );
                }
                if !normalized
                    .chars()
                    .all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-')
                {
                    anyhow::bail!(
                        "google_workspace.allowed_operations[{i}].methods[{j}] contains invalid characters: {normalized}"
                    );
                }
                if !seen_methods.insert(normalized.to_string()) {
                    anyhow::bail!(
                        "google_workspace.allowed_operations[{i}].methods contains duplicate entry: {normalized}"
                    );
                }
            }

            let sub_key = operation
                .sub_resource
                .as_deref()
                .map(str::trim)
                .unwrap_or("");
            let operation_key = format!("{service}:{resource}:{sub_key}");
            if !seen_gws_operations.insert(operation_key.clone()) {
                anyhow::bail!(

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Use the bare camelCase method name ("get", "list", "quickAdd")
  2. Strip dots/slashes: "files.list" becomes either "list" or "files_list" depending on which segment is the method
  3. Re-run validation after the fix

Example fix

# before
[[google_workspace.allowed_operations]]
service = "calendar"
resource = "events"
methods = ["quickAdd", "events.list"]

# after
[[google_workspace.allowed_operations]]
service = "calendar"
resource = "events"
methods = ["quickAdd", "list"]
Defensive patterns

Strategy: validation

Validate before calling

fn is_valid_gws_method(m: &str) -> bool {
    m.chars().all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-')
}

Type guard

fn is_valid_gws_method(m: &str) -> bool {
    !m.trim().is_empty()
        && m.chars().all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-')
}

Try / catch

match config.validate() {
    Ok(()) => {}
    Err(e) if e.to_string().contains("methods[") && e.to_string().contains("invalid characters") => {
        // replace dotted RPC-style names with the bare camelCase verb
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: An operation entry with a method like "files.list", "get/list", or "patch " inside the methods array failing the character check during Config::validate().

Common situations: Transcribing RPC-style dotted names ("calendarList.get") from API docs; pasting HTTP path segments; smart quotes or non-breaking spaces introduced by rich-text editors.

Understand the failure class

Related errors


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