Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 09:45 UTC
feat: forward user_id on tool proxy execute (#4772)
## Summary Proxy execute is getting the same `user_id` 2FA check that trigger upsert/patch got (#3576). This adds `user_id` to the SDK proxy calls so callers can send it: - **TS:** `composio.tools.proxyExecute({ ..., connectedAccountId, userId })` sends `user_id`. - **Python:** `composio.tools.proxy(..., connected_account_id=..., user_id=...)` sends `user_id`. On projects with 2FA enabled, the backend checks `user_id` against the connected account. For orgs created on or after 2026-10-12 it also refuses calls that don't send it. Without this change, those orgs can't use proxy execute from the SDK. ## Notes - **Mergeable now.** It doesn't wait on a client regen the way #3576 did. The current backend drops unknown body fields, so sending `user_id` before the backend change deploys is a no-op. - **TS:** the field goes into the existing `proxyBody` cast. - **Python:** the generated `composio-client` doesn't yet have `user_id` on `tools.proxy`, so it goes through `extra_body`. A TODO marks where to switch to the native param once the client is regenerated. - **Changeset:** `@composio/core` minor. ## Tests - TS `tools.test.ts`: `userId` is forwarded as `user_id`. - Python `test_tools_proxy.py`: checks the HTTP request body. `user_id` is sent when passed and left out otherwise. - Ran: `pnpm --filter @composio/core typecheck`, `oxlint`, the vitest `proxyExecute` suite, `nox -s chk`, and pytest for `test_tools_proxy.py` and `test_no_retry_writes.py`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Anshu Garg [zen] <anshu@composio.dev> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>