@devries-cameron20 / composio Mirror · read-only / commits / e74bffe23
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.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 00:45 UTC

refactor: simplify multi_account types now that client alpha.64 includes the field

Remove the SessionCreateParams intersection cast — multi_account is now in the Stainless-generated types after Hermes PR #9266 landed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

abir committed Apr 9, 2026 at 22:43 UTC e74bffe237aca99aa8aa11f36b8bfa0c3ab98359
1 file changed +2 -12
ts/packages/core/src/models/ToolRouter.ts
+2 -12
@@ -128,14 +128,7 @@ export class ToolRouter<
128
129 const multiAccountPayload = transformToolRouterMultiAccountParams(routerConfig.multiAccount);
130
131 - // multi_account not yet in SessionCreateParams — cast until next client release
132 - const payload: SessionCreateParams & {
133 - multi_account?: {
134 - enable?: boolean;
135 - max_accounts_per_toolkit?: number;
136 - require_explicit_selection?: boolean;
137 - };
138 - } = {
131 + const payload: SessionCreateParams = {
132 user_id: userId,
133 auth_configs: routerConfig.authConfigs,
134 connected_accounts: routerConfig.connectedAccounts,
@@ -146,13 +139,10 @@ export class ToolRouter<
139 routerConfig.manageConnections
140 ),
141 workbench: transformToolRouterWorkbenchParams(routerConfig.workbench),
142 + multi_account: multiAccountPayload,
143 experimental: Object.keys(experimentalPayload).length > 0 ? experimentalPayload : undefined,
144 };
145
152 - if (multiAccountPayload) {
153 - payload.multi_account = multiAccountPayload;
154 - }
155 -
146 const session = await this.client.toolRouter.session.create(payload);
147
148 // Build custom tools map from the response's slug/original_slug mapping