{"record":{"id":"dcd38219313f2352","repo":"tinyhumansai/openhuman","slug":"no-redirect-url-in-composio-v2-response","errorCode":null,"errorMessage":"No redirect URL in Composio v2 response","messagePattern":"No redirect URL in Composio v2 response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/integrations/composio/tools/direct.rs","lineNumber":611,"sourceCode":"        let resp = self\n            .client()\n            .post(&url)\n            .header(\"x-api-key\", &self.api_key)\n            .json(&body)\n            .send()\n            .await?;\n\n        if !resp.status().is_success() {\n            let err = response_error(resp).await;\n            anyhow::bail!(\"Composio v2 connect failed: {err}\");\n        }\n\n        let result: serde_json::Value = resp\n            .json()\n            .await\n            .context(\"Failed to decode Composio v2 connect response\")?;\n        extract_redirect_url(&result)\n            .ok_or_else(|| anyhow::anyhow!(\"No redirect URL in Composio v2 response\"))\n    }\n\n    /// List the user's connected accounts on Composio v3.\n    ///\n    /// GET `https://backend.composio.dev/api/v3/connected_accounts` with\n    /// `x-api-key: <user_key>`. Returns the raw item list; reshaping\n    /// into [`super::super::super::composio::types::ComposioConnection`]\n    /// happens at the call site in `composio/client.rs::direct_list_connections`.\n    ///\n    /// The v3 envelope is `{ items: [{ id, status, toolkit, created_at, ... }] }`.\n    /// Toolkit may arrive as either a plain string slug or as a nested\n    /// object — we tolerate both via [`ComposioConnectedAccount::toolkit_slug`].\n    /// This matches the same upstream shape drift handled by\n    /// `de_string_or_object` in `composio/types.rs`.\n    pub async fn list_connected_accounts(&self) -> anyhow::Result<Vec<ComposioConnectedAccount>> {\n        let url = format!(\"{}/connected_accounts\", self.base_v3);\n        self.ensure_request_url(&url)?;\n","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/integrations/composio/tools/direct.rs#L593-L629","documentation":"The Composio v2 connect call succeeded (2xx, JSON decoded) but no redirect URL could be extracted from the response — the v2 endpoint returned an unexpected body shape. This is the last resort after v3 also failed.","triggerScenarios":"Thrown at src/openhuman/integrations/composio/tools/direct.rs:611 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the connect request","Verify the app name and entity id are correct for v2 connect","Check Composio status/Docs for a changed v2 response format"],"exampleFix":null,"handlingStrategy":"fallback","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"}