Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(sdk): resolve toolkit versions case-insensitively in both SDKs (#3762)
## Summary Toolkit version maps are keyed by **normalized (lowercase) slugs** on the *write* side — env vars (`COMPOSIO_TOOLKIT_VERSION_*`) and user-supplied dicts both get their keys lowercased when the map is built. But the *lookup* read the map with the **raw slug**. A pin configured under a different casing (e.g. `{ "GitHub": "20250101_00" }` or `COMPOSIO_TOOLKIT_VERSION_GITHUB` looked up as `GitHub`) therefore missed the map and silently fell back to `"latest"`, which `Tools.execute` then rejects with a version-required error — discarding the user's explicit pin. Rather than patch only the read side, this **centralizes the normalization rule** into a single helper per SDK and routes **both** the map-building (write) and lookup (read) paths through it, so the two sides can never drift apart again: - **Python** — `normalize_toolkit_slug()` in `python/composio/utils/toolkit_version.py` - **TypeScript** — `normalizeToolkitSlug()` in `ts/packages/core/src/utils/toolkitVersion.ts`, imported by `getToolkitVersionsFromEnv` in `sdk.ts` Behavior is now identical across the two SDKs. This **supersedes #3759**, which patched only the Python read side and left TS diverging. ## Backend verification Confirmed against the backend (staging, **1403 toolkits across 15 pages**): every toolkit `slug` is already lowercase (the mixed-case `name` field is display-only). So the *primary* execute path — which resolves via `tool.toolkit.slug` — was never broken in practice. This change: - **hardens** the direct-util and mixed-case-config paths (a user passing `{ "GitHub": "…" }` now resolves as expected), and - **removes a latent cross-SDK divergence**: the TS suite previously asserted `getToolkitVersion` was *case-sensitive* (`versions.test.ts`), locking in the bug for an input the production code path can't actually produce. That test is flipped to assert case-insensitive resolution. ## Tests - **Python** (`python/tests/test_toolkit_version.py`): case-insensitive lookup via `get_toolkit_versions` round-trip, and against a raw pre-normalized map. `18 passed`. - **TypeScript** (`ts/packages/core/test/core/versions.test.ts`): replaced the case-sensitivity assertion with case-insensitive resolution + a write→read round-trip of a mixed-case user pin. Full core suite `997 passed`. - Typecheck (`tsc --noEmit`) clean; `ruff` clean. ## Notes - Changeset added: `@composio/core` patch. - No public API change; the fix is behavioral (case-insensitive) plus an internal shared helper.