Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
feat(core): accept proxyExecute on session create and update (PLEN-4324) (#4764)
## Summary Today a session exposes the `COMPOSIO_PROXY_EXECUTE` meta tool only when it is created with `proxy_execute.enable: true` ([platform#13454](https://github.com/ComposioHQ/platform/pull/13454)), and neither SDK can send that field. SDK users have to create the session with a raw `POST /api/v3.1/tool_router/session` call and then load it with `sessions.use()`. After this PR both SDKs accept the option on `sessions.create()` and `session.update()`. Ticket: [PLEN-4324](https://linear.app/composio/issue/PLEN-4324/sdk-accept-proxy-executeenable-when-creating-a-session) Designated PR reviewer: @jkomyno ## Changes - TypeScript: `proxyExecute: { enable: boolean }` on `sessions.create()` and `session.update()`. On update, `null` removes the stored block. - Python: `proxy_execute={"enable": bool}` on `sessions.create()` and `session.update()`. On update, `None` removes the stored block. `ToolRouterProxyExecuteConfig` is exported from `composio.types`. - The block is sent only when given, never defaulted. The API treats no block, `enable: true` and `enable: false` differently: an explicit `false` also turns off the sandbox `proxy_execute()` helper. - `enable` is required inside the block, matching the API and the generated client. The TypeScript SDK rejects `proxyExecute: {}` before the request. - Both SDKs pass the field through the generated client's own `proxy_execute` parameter, typed since `@composio/client` 2.0.0-rc.11 / `composio-client` 2.0.0rc11. ## Type of change - [x] New feature ## How Has This Been Tested? Tests were written first and failed before the change. - `pnpm exec vitest run test/models/toolRouter.test.ts test/lib/toolRouterParams.test.ts` in `ts/packages/core`: 231 passed. - `pnpm --filter @composio/core typecheck`: clean. - `uv run pytest tests/test_tool_router.py` in `python`: 185 passed. - `ruff format` and `ruff check` with `config/ruff.toml` on the changed Python files: clean. `mypy` reports nothing in the changed files. - `prettier --check` on the changed TypeScript files: clean. Not run: the full TypeScript and Python suites, and a call against the live API. ## Review notes - The create-time rule (`proxy_execute.enable: false` with an explicit `enable_proxy_execution: true` is a 400) is left to the API. The SDK does not duplicate it. - The read-back needs no SDK change: `session.config.proxy_execute` is already typed by the generated client in both languages, and is absent while the block is unset. - The docs for this option are in [#4740](https://github.com/ComposioHQ/composio/pull/4740), which uses the same names (`proxyExecute: { enable: true }`, `proxy_execute={"enable": True}`) and merges after this is released. ## Checklist - [x] I ran linters/tests locally and they passed - [x] I added tests - [x] I added a changeset (`@composio/core` patch) - [ ] I have read and understand every line of this diff, including any LLM-generated code 🤖 Generated with [Claude Code](https://claude.com/claude-code)
No changes.