{"record":{"id":"e7b26f8ed83d4530","repo":"tinyhumansai/openhuman","slug":"query-is-required","errorCode":null,"errorMessage":"--query is required","messagePattern":"--query is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/memory_cli.rs","lineNumber":343,"sourceCode":"                    .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(())\n}","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/core/memory_cli.rs#L325-L361","documentation":"Post-parse required-argument check in `openhuman memory query`. The query text is optional during parsing and unwrapped with ok_or_else after the loop; with no --query/-q given there is nothing to search for, so the command rejects the invocation before contacting the memory store.","triggerScenarios":"Thrown at src/core/memory_cli.rs:343 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the search text: `--query \"some text\"` (short form -q).","Quote the query if it contains spaces.","Run `openhuman memory query --help` for the full usage line."],"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-14T00:17:10.932Z"}