Skip to content

fix(api): align Composio discover and resolve on one toolkit version (#5174) - #5814

Open
mmabrouk wants to merge 1 commit into
release/v0.110.0from
fix/composio-version-alignment-5174
Open

fix(api): align Composio discover and resolve on one toolkit version (#5174)#5814
mmabrouk wants to merge 1 commit into
release/v0.110.0from
fix/composio-version-alignment-5174

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Aug 7, 2026

Copy link
Copy Markdown
Member

Problem

Composio's discovery path and its resolve/execute path used different implicit toolkit-version scopes, so discovery surfaced tools that resolve/execute then 404 — the "tools that don't exist" bug (#5174).

The tools adapter ran everything against the v3 default, but COMPOSIO_SEARCH_TOOLS returns action slugs spelled at the v3.1 toolkit version. Composio spells slugs differently per version, so a subset of search-recommended slugs 404 with Tool_ToolNotFound (code 2401) when get_action/execute resolve them on v3.

Empirical findings (live Composio API)

Verified against the live key across github/slack/gmail/googlesheets/notion:

Observation Result
v3 default vs v3.1 slug spelling Different for the same action
Search slugs that 404 (Tool_ToolNotFound) on v3 9 real slugs, e.g. GMAIL_GET_DRAFT, GMAIL_UPDATE_DRAFT, GOOGLESHEETS_VALUES_GET/UPDATE, NOTION_UPSERT_ROW_DATABASE
Those same slugs on v3.1 Resolve 200 (GET) and execute-resolve (no Tool_ToolNotFound)
Self-consistency on v3.1 125/125 v3.1-list slugs GET-resolve AND execute-resolve
/toolkits + COMPOSIO_SEARCH_TOOLS on v3.1 Both work
v3.1 backward-lenient to v3 long slugs? No (46/166 miss) — so list+get+execute must move together

The execute-side 404 ConnectedAccountNotFound (code 1810) is a different 404 and means the slug was found; only Tool_ToolNotFound (2401) is the bug.

Fix

Pin only the tools adapter (list / search / get_action / execute — all in ComposioToolsAdapter) to Composio API v3.1, via a new ComposioConfig.tools_api_url. It's derived from api_url, so a self-hosted host override is preserved and only the version segment is forced to v3.1; COMPOSIO_TOOLS_API_URL overrides it explicitly.

The connections, triggers, and integration-catalog adapters only talk to version-agnostic /toolkits, never surface action slugs, and are left on v3 — keeping the change minimal and avoiding untested changes to auth/webhook flows.

The catalog.py list comment is updated: slug consistency now comes from the pinned base URL, not from avoiding a toolkit_versions param — and the warning against adding a per-call version override is kept.

Tests

api/oss/tests/pytest/unit/tools/test_composio_version_alignment.py:

  • Unit (always run): tools_api_url derivation — default→v3.1, already-v3.1, trailing slash, self-hosted host preserved, explicit override.
  • Integration (@pytest.mark.integration, COMPOSIO_API_KEY-gated): a COMPOSIO_SEARCH_TOOLS slug GET-resolves and execute-resolves under the pinned scope, and still 404s as Tool_ToolNotFound on v3 (guards that the pin is load-bearing).

All 9 pass with the live key; 42 neighboring tools tests still pass. ruff format + ruff check clean.

Fixes #5174

…5174)

Composio spells action slugs differently per toolkit version and its endpoints
scope to different versions by default. The tools adapter ran discovery,
resolution, and execution against the v3 default, but COMPOSIO_SEARCH_TOOLS
returns slugs spelled at the v3.1 toolkit version. A subset of those slugs 404
with Tool_ToolNotFound (code 2401) when get_action/execute resolve them on v3 —
so discovery surfaced "tools that don't exist".

Empirical findings against the live Composio API (github/slack/gmail/googlesheets/
notion):
- v3 default and v3.1 return DIFFERENT action-slug spellings for the same action.
- Of the slugs COMPOSIO_SEARCH_TOOLS recommends, 9 real slugs (e.g. GMAIL_GET_DRAFT,
  GMAIL_UPDATE_DRAFT, GOOGLESHEETS_VALUES_GET/UPDATE, NOTION_UPSERT_ROW_DATABASE)
  GET-404 as Tool_ToolNotFound on v3 default but resolve 200 on v3.1.
- On v3.1 the whole path is self-consistent: 125/125 v3.1-list slugs GET-resolve
  AND execute-resolve (never Tool_ToolNotFound); /toolkits and COMPOSIO_SEARCH_TOOLS
  both work on v3.1; every previously-broken search slug resolves on v3.1.
- v3.1 is not backward-lenient to v3's long slugs, so list+get+execute must move
  together — a partial move would reintroduce the mismatch.

Fix: pin only the tools adapter (list/search/get/execute — all in ComposioToolsAdapter)
to v3.1 via a new ComposioConfig.tools_api_url, derived from api_url so a self-hosted
host override is preserved and only the version segment is forced. The connections,
triggers, and integration-catalog adapters talk to version-agnostic /toolkits and are
left on v3. Updates the catalog.py:212 comment to reflect that slug consistency now
comes from the pinned base URL, not from avoiding a version param. Adds unit tests for
the URL derivation and an integration test (COMPOSIO_API_KEY-gated) that a search slug
resolves and executes under the pinned scope while still 404-ing on v3.

Fixes #5174
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 7, 2026
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 7, 2026 7:18pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b290360-e508-4589-9354-244fa3beb8d0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dosubot dosubot Bot added backend python Pull requests that update Python code labels Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-pr-5814.up.railway.app/w
Project agenta-oss-clone-spike
Image tag pr-5814-46b9c9d
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-08-07T19:21:46.677Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend python Pull requests that update Python code size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant