{"record":{"id":"cecf661df22a3259","repo":"tinyhumansai/openhuman","slug":"memory-tree-drill-down-max-depth-must-be-1","errorCode":null,"errorMessage":"memory_tree_drill_down: max_depth must be >= 1","messagePattern":"memory_tree_drill_down: max_depth must be >= 1","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/memory/query/drill_down.rs","lineNumber":55,"sourceCode":"                    \"type\": \"string\",\n                    \"description\": \"Optional natural-language query — when set, children are reranked by cosine similarity.\"\n                },\n                \"limit\": {\n                    \"type\": \"integer\",\n                    \"minimum\": 0,\n                    \"description\": \"Optional cap on returned hits, applied after rerank.\"\n                }\n            },\n            \"required\": [\"node_id\"]\n        })\n    }\n\n    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        log::debug!(\"[tool][memory_tree] drill_down invoked\");\n        let req: DrillDownRequest = serde_json::from_value(args)\n            .map_err(|e| anyhow::anyhow!(\"invalid arguments for memory_tree_drill_down: {e}\"))?;\n        if matches!(req.max_depth, Some(0)) {\n            return Err(anyhow::anyhow!(\n                \"memory_tree_drill_down: max_depth must be >= 1\"\n            ));\n        }\n        let hits = backend::drill_down(\n            &req.node_id,\n            req.max_depth.unwrap_or(1),\n            req.query.as_deref(),\n            req.limit,\n        )\n        .await?;\n        log::debug!(\n            \"[tool][memory_tree] drill_down returning hits={}\",\n            hits.len()\n        );\n        let json = serde_json::to_string(&hits)?;\n        Ok(ToolResult::success(json))\n    }\n}","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/memory/query/drill_down.rs#L37-L73","documentation":"Semantic guard on drill_down args: max_depth was provided but is zero (or negative after parsing). The tree walk requires at least one level; the check runs immediately after parsing, before the driver is touched.","triggerScenarios":"Thrown at src/openhuman/memory/query/drill_down.rs:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set max_depth to 1 or higher","Omit max_depth to use the default depth"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}