tinyhumansai/openhuman · error · anyhow::Error

Composio v3 connect failed: {err}

Error message

Composio v3 connect failed: {err}

What it means

Non-2xx from the v3 POST that initiates an OAuth connection (get_connection_url_v3). The body carries provider/app identifiers and the entity; response_error folds status + body into {err}. On success the code extracts a redirect URL — this error is the non-2xx branch before that.

Source

Thrown at src/openhuman/integrations/composio/tools/direct.rs:570

        };

        let url = format!("{}/connected_accounts/link", self.base_v3);
        let body = json!({
            "auth_config_id": auth_config_id,
            "user_id": entity_id,
        });

        let resp = self
            .client()
            .post(&url)
            .header("x-api-key", &self.api_key)
            .json(&body)
            .send()
            .await?;

        if !resp.status().is_success() {
            let err = response_error(resp).await;
            anyhow::bail!("Composio v3 connect failed: {err}");
        }

        let result: serde_json::Value = resp
            .json()
            .await
            .context("Failed to decode Composio v3 connect response")?;
        extract_redirect_url(&result)
            .ok_or_else(|| anyhow::anyhow!("No redirect URL in Composio v3 response"))
    }

    async fn get_connection_url_v2(
        &self,
        app_name: &str,
        entity_id: &str,
    ) -> anyhow::Result<String> {
        let url = format!("{}/connectedAccounts", self.base_v2);

        let body = json!({

View on GitHub (pinned to 7491200858)

Solutions

  1. Inspect {err} for the status and Composio's message
  2. If it points at a missing auth config, create one in the Composio dashboard for that toolkit, or pass a known-good auth_config_id
  3. Confirm the toolkit slug spelling matches Composio's registry
  4. 401: re-enter the API key in Connections > Composio
Defensive patterns

Strategy: try-catch

Try / catch

match tool.get_connection_url_v3_path(app, auth_config_id, &entity).await {
    Ok(url) => Ok(url),
    Err(e) => {
        let msg = format!("{e:#}");
        if msg.contains("No auth config") || msg.contains("404") {
            ui.explain_create_auth_config(app); // user must configure Composio first
        }
        Err(e)
    }
}

Prevention

When it happens

Trigger: auth_config_id that does not exist or belongs to another workspace; toolkit_slug with no auth config; 401 invalid API key; 429/5xx. Example: get_connection_url(Some("jira"), None, entity) when the workspace has no Jira auth config.

Common situations: Stale auth_config_id cached from a previous workspace; toolkit slug typo; trying to connect an app the Composio account has not enabled.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/f8cd8a7a3e7e2921. Report an issue: GitHub.