fix(composio): connections URL built from LLM base URL instead of backend URL
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: [email protected]
- 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
- Trace where
IntegrationClientgets itsbackend_url— verify it's sourced from the backend API config, not the LLM provider config - Add a debug assertion / startup log that
backend_urldoes not contain/chat/completionsor/v1/ - 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
Picking this one up. Just opened #2101 with the fix — the env-fallback path wasn't stripping the inference URL prefix, so the integration calls were getting the LLM endpoint glued onto them.
Hey @obchain already working on this.
Seems like you have already raised a PR on this.. No worries.. Please fix the code rabbit issues