{"record":{"id":"281b7aaceeade91f","repo":"zeroclaw-labs/zeroclaw","slug":"embedding-route-has-invalid-dimensions-0","errorCode":null,"errorMessage":"embedding route \"{}\" has invalid dimensions=0","messagePattern":"embedding route \"(.+?)\" has invalid dimensions=0","errorType":"console","errorClass":"DiagItem","httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-runtime/src/doctor/mod.rs","lineNumber":1285,"sourceCode":"            items.push(DiagItem::warn(cat, \"embedding route with empty hint\"));\n        }\n        if let Some(reason) = embedding_provider_validation_error(&route.model_provider) {\n            items.push(DiagItem::warn(\n                cat,\n                format!(\n                    \"embedding route \\\"{}\\\" uses invalid model_provider \\\"{}\\\": {}\",\n                    route.hint, route.model_provider, reason\n                ),\n            ));\n        }\n        if route.model.trim().is_empty() {\n            items.push(DiagItem::warn(\n                cat,\n                format!(\"embedding route \\\"{}\\\" has empty model\", route.hint),\n            ));\n        }\n        if route.dimensions.is_some_and(|value| value == 0) {\n            items.push(DiagItem::warn(\n                cat,\n                format!(\n                    \"embedding route \\\"{}\\\" has invalid dimensions=0\",\n                    route.hint\n                ),\n            ));\n        }\n    }\n\n    if let Some(hint) = config\n        .memory\n        .embedding_model\n        .strip_prefix(\"hint:\")\n        .map(str::trim)\n        .filter(|value| !value.is_empty())\n        && !config\n            .embedding_routes\n            .iter()","sourceCodeStart":1267,"sourceCodeEnd":1303,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/doctor/mod.rs#L1267-L1303","documentation":"A `zeroclaw doctor` warning from `check_config_semantics`: an `[[embedding_routes]]` entry sets `dimensions = 0`. Zero is not a usable embedding vector size, so any request through that route would produce invalid vectors or be rejected upstream. The check only fires when `dimensions` is explicitly `Some(0)`; omitting the key is valid.","triggerScenarios":"Running `zeroclaw doctor`/`diagnose` on a config where an `[[embedding_routes]]` table contains `dimensions = 0` (the code checks `route.dimensions.is_some_and(|value| value == 0)`).","commonSituations":"A template initialized `dimensions = 0` as a placeholder; a numeric field was commented out incorrectly and set to zero; scripted config generation that defaults integer fields to 0 instead of omitting them.","solutions":["Set `dimensions` to the model's real vector size (e.g. 1536 for text-embedding-3-small), or delete the `dimensions` key to let the provider default apply.","Never use 0 as a placeholder for optional numeric config; omit the key instead.","Re-run `zeroclaw doctor` to confirm the route passes validation."],"exampleFix":"# before\n[[embedding_routes]]\nhint = \"openai\"\nmodel = \"text-embedding-3-small\"\ndimensions = 0\n\n# after\n[[embedding_routes]]\nhint = \"openai\"\nmodel = \"text-embedding-3-small\"\ndimensions = 1536","handlingStrategy":"validation","validationCode":"for route in &config.embedding_routes {\n    if let Some(dims) = route.dimensions {\n        assert!(dims > 0, \"embedding route \\\"{}\\\" dimensions must be > 0\", route.hint);\n    }\n}","typeGuard":"fn dimensions_are_valid(dims: Option<u64>) -> bool {\n    dims.map_or(true, |d| d > 0)\n}","tryCatchPattern":null,"preventionTips":["Treat optional integers as absent, not zero, when unknown.","Validate config in a pre-deploy step (the same signal doctor uses) before daemon start."],"tags":["config","embeddings","doctor","toml","zeroclaw"],"backgroundTag":"config-validation-failed","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}