Skip to content

fix(composio): connections URL built from LLM base URL instead of backend URL #2075

@graycyrus

Description

@graycyrus

Bug Report

Description

Composio integration requests are sent to the wrong URL — the composio /agent-integrations/composio/connections path is appended to the LLM provider's base URL instead of the backend API URL, producing 404s.

Sentry issues:

  • OPENHUMAN-TAURI-H6 — GET https://api.tinyhumans.ai/openai/v1/chat/completions/agent-integrations/composio/connections → 404 (103 events)
  • OPENHUMAN-TAURI-HN — GET https://openrouter.ai/api/v1/chat/completions/agent-integrations/composio/connections → 404 (50 events)

Combined impact: 153 events. Composio connections always fail for affected users — they can never see or manage their integrations.

Error

Backend returned 404 Not Found for GET https://api.tinyhumans.ai/openai/v1/chat/completions/agent-integrations/composio/connections

The URL should be https://api.tinyhumans.ai/agent-integrations/composio/connections but the LLM endpoint path (/openai/v1/chat/completions) is prepended.

  • Platform: Windows x86_64 (10.0.26200)
  • Version: openhuman@0.53.45
  • Environment: production

Root Cause Analysis

src/openhuman/composio/client.rs:445 — The composio client calls crate::api::config::api_url(&self.inner.backend_url, path) to build request URLs. The backend_url should be the OpenHuman backend base (e.g. https://api.tinyhumans.ai), but for some users it's being set to the LLM provider's chat completions URL instead.

The H6 URL is api.tinyhumans.ai/openai/v1/chat/completions + /agent-integrations/composio/connections. The HN URL is openrouter.ai/api/v1/chat/completions + the same path. This means the IntegrationClient is being constructed with the wrong base URL — likely the LLM provider URL leaking into the composio client's config.

Cascade

Call site Behavior
list_connections Always returns 404 → no integrations visible
delete_connection Would also 404 → can't disconnect
All composio operations using this client Broken

Proposed Fix

  1. Trace where IntegrationClient gets its backend_url — verify it's sourced from the backend API config, not the LLM provider config
  2. Add a debug assertion / startup log that backend_url does not contain /chat/completions or /v1/
  3. Add a test that constructs a composio client with various config shapes and verifies the URL

Labels

sentry-traced-bug, os:windows, bug, priority: high, area: core

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions