@hemant838 is attempting to deploy a commit to the Composio Team on Vercel.
A member of the Team first needs to authorize it.
Stateless backends (e.g. a chat API where each HTTP request is independent) need to resume the
same session across user turns to preserve workbench state — accumulated files, execution context,
etc. The correct pattern is to call composio.create() once, store the sessionId, then call
composio.use(sessionId) on every subsequent turn.
This pattern broke silently when experimental custom toolkits were involved: composio.create()
accepted experimental.customTools / experimental.customToolkits, but composio.use() only
took a session ID and had no way to restore the custom-tool routing. Developers were forced to call
create() on every turn instead, which may return a different session ID and silently lose
workbench files.
Fixes #
ToolRouterUseSessionConfig type (and its Zod schema) to toolRouter.types.ts with
userId and experimental.customTools / experimental.customToolkits fieldsToolRouter.use() to accept an optional second config argument — when custom
tools/toolkits are provided, it builds the CustomToolsMap client-side using the existing
deterministic buildCustomToolsMap() and passes it to ToolRouterSession (no extra API calls)use property type on the Composio class to match the new signatureuse method describe block: custom tools, custom toolkits,
missing-userId guard, and tool execution on a resumed sessionAdded unit tests in ts/packages/core/test/models/toolRouter.test.ts inside the existing
use method describe block:
cd ts/packages/core
node_modules/.bin/vitest run test/models/toolRouter.test.ts
# 96 passed
@hemant838 is attempting to deploy a commit to the Composio Team on Vercel.
A member of the Team first needs to authorize it.