{"record":{"id":"a7e8e09516e4aa24","repo":"zeroclaw-labs/zeroclaw","slug":"field-must-be-a-string-or-string","errorCode":null,"errorMessage":"'{field}' must be a string or string[]","messagePattern":"'(.+?)' must be a string or string\\[\\]","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-tools/src/model_routing_config.rs","lineNumber":116,"sourceCode":"                let value = item.as_str().ok_or_else(|| {\n                    ::zeroclaw_log::record!(\n                        WARN,\n                        ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Reject)\n                            .with_outcome(::zeroclaw_log::EventOutcome::Failure)\n                            .with_attrs(::serde_json::json!({\"field\": field})),\n                        \"model_routing_config: array element must be a string\"\n                    );\n                    anyhow::Error::msg(format!(\"'{field}' array must only contain strings\"))\n                })?;\n                let trimmed = value.trim();\n                if !trimmed.is_empty() {\n                    out.push(trimmed.to_string());\n                }\n            }\n            return Ok(out);\n        }\n\n        anyhow::bail!(\"'{field}' must be a string or string[]\")\n    }\n\n    fn parse_delegate_targets(\n        raw: &Value,\n        field: &str,\n    ) -> anyhow::Result<Vec<DelegateTargetConfig>> {\n        // Keep the config-editing tool as permissive as the schema loader:\n        // operators may pass a comma-separated legacy string, a string array,\n        // or object entries with explicit mode. The stored config still uses\n        // `DelegateTargetConfig`, so mode semantics are not reimplemented here.\n        if let Some(raw_string) = raw.as_str() {\n            return Ok(raw_string\n                .split(',')\n                .map(str::trim)\n                .filter(|entry| !entry.is_empty())\n                .map(DelegateTargetConfig::bounded)\n                .collect());\n        }","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-tools/src/model_routing_config.rs#L98-L134","documentation":"Error \"'{field}' must be a string or string[]\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-tools/src/model_routing_config.rs:116 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the field as a string or an array of strings."],"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"}