{"record":{"id":"7016742d26c4c2c8","repo":"tinyhumansai/openhuman","slug":"namespace-is-required-for-query","errorCode":null,"errorMessage":"--namespace is required for query","messagePattern":"--namespace is required for query","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/memory_cli.rs","lineNumber":342,"sourceCode":"                    .parse::<u32>()\n                    .map_err(|e| anyhow::anyhow!(\"invalid --limit: {e}\"))?;\n            }\n            \"-v\" | \"--verbose\" => {\n                verbose = true;\n                i += 1;\n            }\n            \"-h\" | \"--help\" => {\n                println!(\n                    \"Usage: openhuman memory query --namespace <ns> --query <text> [--limit <n>] [-v]\"\n                );\n                return Ok(());\n            }\n            other => return Err(anyhow::anyhow!(\"unknown query arg: {other}\")),\n        }\n    }\n\n    let namespace =\n        namespace.ok_or_else(|| anyhow::anyhow!(\"--namespace is required for query\"))?;\n    let query = query.ok_or_else(|| anyhow::anyhow!(\"--query is required\"))?;\n\n    crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);\n\n    let rt = tokio::runtime::Builder::new_multi_thread()\n        .enable_all()\n        .build()?;\n\n    let result = rt.block_on(async {\n        let client = create_memory_client(\"query\").await?;\n        client\n            .query_namespace(&namespace, &query, limit)\n            .await\n            .map_err(anyhow::Error::msg)\n    })?;\n\n    println!(\"{result}\");\n    Ok(())","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/core/memory_cli.rs#L324-L360","documentation":"Post-parse required-argument check in `openhuman memory query`. After the arg loop finishes, the optional namespace is unwrapped via ok_or_else; if the user never passed --namespace/-n, the command cannot scope the memory query and fails before any RPC call is made.","triggerScenarios":"Thrown at src/core/memory_cli.rs:342 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a namespace: `openhuman memory query --namespace <ns> --query <text>`.","List valid namespaces first with `openhuman memory namespaces`.","Use -n as the short form of --namespace."],"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-23T08:17:48.524Z"}