{"record":{"id":"bffb6aca8afb2a3b","repo":"tinyhumansai/openhuman","slug":"name","errorCode":null,"errorMessage":"{name}: {}","messagePattern":"\\{name\\}: \\{\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/threads/tools.rs","lineNumber":54,"sourceCode":"        .and_then(serde_json::Value::as_str)\n        .map(str::trim)\n        .filter(|s| !s.is_empty())\n        .map(str::to_string)\n        .ok_or_else(|| anyhow::anyhow!(\"missing required string argument `{key}`\"))\n}\n\n/// Deserialize tool args into a request struct with a uniform error.\nfn parse_req<T: serde::de::DeserializeOwned>(\n    args: serde_json::Value,\n    tool: &str,\n) -> anyhow::Result<T> {\n    serde_json::from_value(args).map_err(|e| anyhow::anyhow!(\"{tool}: invalid arguments: {e}\"))\n}\n\n/// Emit a thread ops `RpcOutcome` envelope as a JSON tool result.\nmacro_rules! emit {\n    ($outcome:expr, $name:literal) => {{\n        let outcome = $outcome.map_err(|e| anyhow::anyhow!(concat!($name, \": {}\"), e))?;\n        Ok(ToolResult::success(serde_json::to_string(&outcome.value)?))\n    }};\n}\n\n/// List conversation threads.\npub struct ThreadListTool;\n\n#[async_trait]\nimpl Tool for ThreadListTool {\n    fn name(&self) -> &str {\n        \"thread_list\"\n    }\n\n    fn description(&self) -> &str {\n        \"List conversation threads (id, title, labels, timestamps). Use to find \\\n         a thread id before reading its messages, retitling, or relabeling.\"\n    }\n","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/threads/tools.rs#L36-L72","documentation":"Uniform error from the emit! macro family: a thread ops call returned a non-success RpcOutcome envelope, and the error string from the outcome is surfaced with the tool name prefix. The concrete failure is whichever ops method the calling tool invoked.","triggerScenarios":"Thrown at src/openhuman/threads/tools.rs:54 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded outcome error text for the real cause (not-found, permission, persistence)","Confirm ids (thread_id, message id) reference existing entities","Retry transient persistence failures once"],"exampleFix":null,"handlingStrategy":"try-catch","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"}