Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(cli): align test mocks with @composio/client alpha.67 SessionCreateResponse
The stainless client bump from alpha.66 to alpha.67 (pulled in by the sandbox-size commit on this branch) added two newly-required fields on SessionCreateResponse that the CLI tool-router test mocks do not return: - `config_version: number` at the top level - `preload: { tools: string[] }` inside `config` Add both to every `toolRouter.create` mock so `pnpm typecheck:test` passes again. The values are arbitrary fixtures (`config_version: 1`, empty `preload.tools`) — none of these tests assert on those fields. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Zen Agent committed
Apr 28, 2026 at 11:55 UTC
507588923db2881bb8cb7ad2b2a9dadf87a32461
4 files changed
+18
-9
ts/packages/cli/test/src/commands/connected-accounts/connected-accounts.link.cmd.test.ts
+2
-1
@@ -82,7 +82,8 @@ const RecordingTerminalUI = TerminalUI.of({
82
describe('CLI: composio dev connected-accounts link', () => {
83
const toolRouterCreateSpy = vi.fn(async () => ({
84
session_id: 'trs_test_session',
85
- config: { user_id: 'consumer-user-org_test' },
85
+ config: { user_id: 'consumer-user-org_test', preload: { tools: [] } },
86
+ config_version: 1,
87
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
88
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS', 'COMPOSIO_MANAGE_CONNECTIONS'],
89
}));
ts/packages/cli/test/src/commands/proxy.cmd.test.ts
+4
-2
@@ -56,7 +56,8 @@ describe('CLI: composio proxy', () => {
56
createParams = params;
57
return {
58
session_id: 'trs_proxy_test',
59
- config: { user_id: params.user_id },
59
+ config: { user_id: params.user_id, preload: { tools: [] } },
60
+ config_version: 1,
61
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
62
tool_router_tools: [],
63
};
@@ -141,7 +142,8 @@ describe('CLI: composio proxy', () => {
142
createCalled = true;
143
return {
144
session_id: 'trs_proxy_test',
144
- config: { user_id: 'global_test_user_id' },
145
+ config: { user_id: 'global_test_user_id', preload: { tools: [] } },
146
+ config_version: 1,
147
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
148
tool_router_tools: [],
149
};
ts/packages/cli/test/src/commands/tools/tools.execute.cmd.test.ts
+8
-4
@@ -188,7 +188,8 @@ describe('CLI: composio execute', () => {
188
recordedSessionCreateParams.push(params as unknown as Record<string, unknown>);
189
return {
190
session_id: 'trs_gmail_default_session',
191
- config: { user_id: params.user_id },
191
+ config: { user_id: params.user_id, preload: { tools: [] } },
192
+ config_version: 1,
193
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
194
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS', 'COMPOSIO_MANAGE_CONNECTIONS'],
195
};
@@ -270,7 +271,8 @@ describe('CLI: composio execute', () => {
271
recordedSessionCreateParams.push(params as unknown as Record<string, unknown>);
272
return {
273
session_id: 'trs_gmail_explicit_session',
273
- config: { user_id: params.user_id },
274
+ config: { user_id: params.user_id, preload: { tools: [] } },
275
+ config_version: 1,
276
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
277
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS', 'COMPOSIO_MANAGE_CONNECTIONS'],
278
};
@@ -333,7 +335,8 @@ describe('CLI: composio execute', () => {
335
recordedSessionCreateParams.push(params as unknown as Record<string, unknown>);
336
return {
337
session_id: 'trs_posthog_test_session',
336
- config: { user_id: params.user_id },
338
+ config: { user_id: params.user_id, preload: { tools: [] } },
339
+ config_version: 1,
340
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
341
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS', 'COMPOSIO_MANAGE_CONNECTIONS'],
342
};
@@ -384,7 +387,8 @@ describe('CLI: composio execute', () => {
387
recordedSessionCreateParams.push(params as unknown as Record<string, unknown>);
388
return {
389
session_id: 'trs_posthog_cached_session',
387
- config: { user_id: params.user_id },
390
+ config: { user_id: params.user_id, preload: { tools: [] } },
391
+ config_version: 1,
392
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
393
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS', 'COMPOSIO_MANAGE_CONNECTIONS'],
394
};
ts/packages/cli/test/src/commands/tools/tools.search.cmd.test.ts
+4
-2
@@ -384,7 +384,8 @@ describe('CLI: composio search', () => {
384
createParams = params;
385
return {
386
session_id: 'trs_test_session',
387
- config: { user_id: params.user_id },
387
+ config: { user_id: params.user_id, preload: { tools: [] } },
388
+ config_version: 1,
389
mcp: { type: 'http', url: 'https://mcp.test.composio.dev' },
390
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS'],
391
};
@@ -614,7 +615,8 @@ describe('CLI: composio search', () => {
615
createParams = params;
616
return {
617
session_id: 'trs_test_session',
617
- config: { user_id: params.user_id },
618
+ config: { user_id: params.user_id, preload: { tools: [] } },
619
+ config_version: 1,
620
mcp: { type: 'http', url: 'https://mcp.test.composio.dev' },
621
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS'],
622
};