{"record":{"id":"89f9b6806e82576a","repo":"tinyhumansai/openhuman","slug":"composio-client-unavailable-e","errorCode":null,"errorMessage":"composio client unavailable: {e}","messagePattern":"composio client unavailable: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/learning/linkedin_enrichment.rs","lineNumber":521,"sourceCode":"/// **HTML body** — which Gmail returns as base64-encoded data inside\n/// `payload.parts[].body.data`. We must decode those parts before\n/// regex-matching; searching the raw JSON alone misses them.\nasync fn search_gmail_for_linkedin(config: &Config) -> anyhow::Result<Option<String>> {\n    use crate::openhuman::integrations::composio::client::{\n        create_composio_client, direct_execute, ComposioClientKind,\n    };\n    use base64::engine::general_purpose::URL_SAFE_NO_PAD;\n    use base64::Engine;\n\n    // Resolve through the mode-aware factory so a direct-mode user\n    // with a stored API key can still drive Gmail enrichment from the\n    // personal Composio tenant (#1710 Wave 2). Pre-fix this path used\n    // `build_composio_client` and returned early for any user without\n    // a backend session, silently disabling LinkedIn enrichment for\n    // direct-mode users even when their LinkedIn/Gmail connections\n    // were healthy on app.composio.dev.\n    let client_kind = create_composio_client(config)\n        .map_err(|e| anyhow::anyhow!(\"composio client unavailable: {e}\"))?;\n\n    // `comm/in/<username>` — LinkedIn's own notification emails always use\n    // this form to refer to the email *recipient's* profile.\n    static COMM_RE: LazyLock<Regex> =\n        LazyLock::new(|| Regex::new(r\"linkedin\\.com/comm/in/([a-zA-Z0-9_-]+)\").unwrap());\n\n    let args = json!({\n        \"query\": \"from:linkedin.com\",\n        \"max_results\": 10,\n    });\n    let resp = match &client_kind {\n        ComposioClientKind::Backend(client) => client\n            .execute_tool(\"GMAIL_FETCH_EMAILS\", Some(args))\n            .await\n            .map_err(|e| anyhow::anyhow!(\"GMAIL_FETCH_EMAILS failed: {e:#}\"))?,\n        ComposioClientKind::Direct(direct) => {\n            tracing::debug!(\n                \"[linkedin_enrichment][composio-direct] GMAIL_FETCH_EMAILS via direct tenant\"","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/openhuman/agent/learning/linkedin_enrichment.rs#L503-L539","documentation":"Error \"composio client unavailable: {e}\" thrown in tinyhumansai/openhuman.","triggerScenarios":"Thrown at src/openhuman/agent/learning/linkedin_enrichment.rs:521 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}