{"record":{"id":"5f1decd913794cc3","repo":"tinyhumansai/openhuman","slug":"missing-required-parameter-session-id","errorCode":null,"errorMessage":"Missing required parameter 'session_id'","messagePattern":"Missing required parameter 'session_id'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/system/insert_sql_record.rs","lineNumber":78,"sourceCode":"                },\n                \"lesson\": {\n                    \"type\": \"string\",\n                    \"description\": \"Optional distilled lesson extracted from this exchange.\"\n                }\n            }\n        })\n    }\n\n    fn permission_level(&self) -> PermissionLevel {\n        PermissionLevel::Write\n    }\n\n    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        // ── Parameter extraction ────────────────────────────────────────────\n        let session_id = args\n            .get(\"session_id\")\n            .and_then(|v| v.as_str())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing required parameter 'session_id'\"))?;\n\n        let role = args\n            .get(\"role\")\n            .and_then(|v| v.as_str())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing required parameter 'role'\"))?;\n\n        let content = args\n            .get(\"content\")\n            .and_then(|v| v.as_str())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing required parameter 'content'\"))?;\n\n        let lesson = args.get(\"lesson\").and_then(|v| v.as_str());\n\n        // ── Validation ──────────────────────────────────────────────────────\n        if !VALID_ROLES.contains(&role) {\n            return Ok(ToolResult::error(format!(\n                \"Invalid role '{role}'. Must be one of: user, assistant, tool.\"\n            )));","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/system/insert_sql_record.rs#L60-L96","documentation":"insert_sql_record requires 'session_id' to attribute the conversation row; this fires at the top of the parameter-extraction block when args lack a 'session_id' string, before role/content are read or anything is persisted.","triggerScenarios":"Thrown at src/openhuman/tools/impl/system/insert_sql_record.rs:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the current \"session_id\" string with the record arguments"],"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"}