@devries-cameron20 / composio-1 / commits / 73b42a29a
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Support SDK-local custom tool preload for v3.1 (#3349)

## Summary - Add `preload` on TS/Python custom tools and custom toolkits so SDK-created sessions can expose selected custom schemas directly from `session.tools()`. - Keep top-level `preload.tools` for backend-owned Composio tool slugs / `all`; reject custom slugs there with guidance to use the SDK custom definition flag, and reject bare-string Python misuse except `"all"`. - Pass inline custom definitions on create/search so backend validation/search has current definitions without persisting them; direct `session.execute(...)` remains generated-client typed and does not carry custom payload. - Preserve `sessionPreset: "direct_tools"` / `session_preset="direct_tools"`, including explicit override precedence; direct-tools uses `preload.tools = "all"` only when the caller does not override preload. - Add OpenAI Agents SDK examples for explicit preload and `sessionPreset: "direct_tools"` in TS and Python, including toolkit-level preload with a nested `preload: false` / `preload=False` override. ## Validation - `pnpm --dir ts/packages/core test test/models/toolRouter.test.ts test/models/customToolRouting.test.ts` - `pnpm --dir ts/packages/core typecheck` - `env COMPOSIO_CACHE_DIR=/private/tmp/composio-cache python/.nox/chk/bin/python -m pytest python/tests/test_custom_tools.py python/tests/test_tool_router.py` - `python/.nox/chk/bin/python -m ruff check python/examples/tool_router/preload.py python/examples/tool_router/direct_tools_preset.py python/composio/core/models/custom_tool.py python/composio/core/models/custom_tool_types.py python/composio/core/models/tool_router.py python/composio/core/models/tool_router_session.py python/tests/test_custom_tools.py python/tests/test_tool_router.py` - `python/.nox/chk/bin/python -m py_compile python/examples/tool_router/preload.py python/examples/tool_router/direct_tools_preset.py` - `pnpm --dir ts/examples/tool-router exec tsc --noEmit --skipLibCheck --target ES2022 --module ESNext --moduleResolution Bundler --allowSyntheticDefaultImports --strict src/preload.ts src/direct-tools-preset.ts` - `git diff --check`

Dhawal Upadhyay committed May 6, 2026 at 19:06 UTC 73b42a29a89a37dcac146da1c463b2378ed0e57c

No changes.