{"record":{"id":"3cba8bc3cd9bb277","repo":"tinyhumansai/openhuman","slug":"gmail-fetch-emails-failed-e","errorCode":null,"errorMessage":"GMAIL_FETCH_EMAILS failed: {e:#}","messagePattern":"GMAIL_FETCH_EMAILS failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/learning/linkedin_enrichment.rs","lineNumber":536,"sourceCode":"    // 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\"\n            );\n            direct_execute(\n                direct,\n                \"GMAIL_FETCH_EMAILS\",\n                Some(args),\n                &config.composio.entity_id,\n                None,\n            )\n            .await\n            .map_err(|e| anyhow::anyhow!(\"GMAIL_FETCH_EMAILS (direct) failed: {e:#}\"))?\n        }\n    };\n\n    if !resp.successful {\n        let err = resp.error.unwrap_or_else(|| \"unknown error\".into());","sourceCodeStart":518,"sourceCodeEnd":554,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/learning/linkedin_enrichment.rs#L518-L554","documentation":"The Composio GMAIL_FETCH_EMAILS tool call (backend-proxied tenant) returned an error while searching for LinkedIn notification emails — connection not established, Composio/backend auth failure, or Gmail API error. The Gmail stage of profile enrichment fails; the regex over decoded HTML bodies never runs.","triggerScenarios":"Thrown at src/openhuman/agent/learning/linkedin_enrichment.rs:536 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reconnect the Gmail integration on the Composio dashboard and retry","Check the backend session is valid (sign in again) and the Composio connection is healthy","Treat a missing profile URL from Gmail as non-fatal and let the pipeline continue via other stages"],"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-23T08:17:48.524Z"}