{"record":{"id":"99edd5a6334ae1de","repo":"tinyhumansai/openhuman","slug":"memory-tools-put-stored-rule-rule-id-not-found","errorCode":null,"errorMessage":"memory_tools_put: stored rule {rule_id} not found on read-back","messagePattern":"memory_tools_put: stored rule (.+?) not found on read-back","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/memory/tools/tool_memory/put.rs","lineNumber":134,"sourceCode":"        );\n        rule.tags = parsed.tags;\n        let rule_id = rule.id.clone();\n        let tool_name = rule.tool_name.clone();\n        family\n            .put_tool_rule(rule)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"memory_tools_put: {e}\"))?;\n        // `put_tool_rule` answers with unit; the tool's contract is the stored\n        // rule (normalised tool_name, preserved created_at, refreshed\n        // updated_at), so read it back by the id generated above.\n        let stored = family\n            .tool_rules(&tool_name)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"memory_tools_put: {e}\"))?\n            .into_iter()\n            .find(|r| r.id == rule_id)\n            .ok_or_else(|| {\n                anyhow::anyhow!(\"memory_tools_put: stored rule {rule_id} not found on read-back\")\n            })?;\n        log::debug!(\n            \"[tool][memory_tools] put via guard tool_name={} id={} read_back=ok\",\n            stored.tool_name,\n            stored.id\n        );\n        let json = serde_json::to_string(&stored)?;\n        Ok(ToolResult::success(json))\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use std::ffi::OsString;\n\n    use tempfile::TempDir;\n","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/memory/tools/tool_memory/put.rs#L116-L152","documentation":"After `put_tool_rule` reported success, reading the stored rule back by its generated id found no matching entry. The tool's contract is to return the normalized stored rule, so this consistency-check failure indicates the write was not durably visible — a store/module coherence fault (different connection, transaction visibility, or id mismatch), not a caller input problem.","triggerScenarios":"Thrown at src/openhuman/memory/tools/tool_memory/put.rs:134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the put — visibility races can be transient","Check store health and whether the module and host disagree on connections","Inspect the generated rule_id format vs what the store indexes","Report as a module/store bug if persistent"],"exampleFix":null,"handlingStrategy":"retry","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"}