{"record":{"id":"7b9502fb8df64625","repo":"tinyhumansai/openhuman","slug":"lookup-session-e","errorCode":null,"errorMessage":"lookup session: {e}","messagePattern":"lookup session: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/hosted/orchestration/tools.rs","lineNumber":495,"sourceCode":"            .and_then(Value::as_str)\n            .map(str::trim)\n            .filter(|s| !s.is_empty() && !is_pinned_window(s))\n            .map(str::to_string);\n\n        let workspace = self.config.workspace_dir.clone();\n\n        // Guardrail: locally linked peer, accepted tiny.place contact, OR an\n        // existing session with them. Never cold-DM an arbitrary new address\n        // from this un-gated background origin. The live contact check matters\n        // after login changes the workspace: the relay contact remains accepted\n        // while the workspace-local orchestration pairing/session stores start\n        // empty.\n        let linked =\n            crate::openhuman::agent::orchestration::pairing::linked_agent_ids(&workspace).await;\n        let known_session = store::with_connection(&workspace, |conn| {\n            store::latest_session_for_agent(conn, &recipient)\n        })\n        .map_err(|e| anyhow::anyhow!(\"lookup session: {e}\"))?;\n        let accepted_contact = if linked.contains(&recipient) || known_session.is_some() {\n            false\n        } else {\n            match crate::openhuman::agent::orchestration::pairing::is_accepted_contact(&recipient)\n                .await\n            {\n                Ok(accepted) => accepted,\n                Err(e) => {\n                    log::warn!(\n                        target: \"orchestration\",\n                        \"[orchestration] tool.send_to_agent contact check failed: {e}\"\n                    );\n                    false\n                }\n            }\n        };\n        if !recipient_may_receive_message(\n            linked.contains(&recipient),","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/hosted/orchestration/tools.rs#L477-L513","documentation":"The orchestration messaging tool failed to look up the session for the target peer during its guardrail checks (linked peer / accepted contact / existing session). The lookup error — not a guardrail rejection — is wrapped; the tool refuses to proceed because it cannot establish that cold-DMing is permitted.","triggerScenarios":"Thrown at src/openhuman/hosted/orchestration/tools.rs:495 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped session-store error","Verify the peer's session data is readable in the current workspace","Retry after session state recovers"],"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"}