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 21, 22:15 UTC
bump generated clients for v3.1
Dhawal Upadhyay committed
May 5, 2026 at 14:23 UTC
82e0038c7cd2b7438cfb445dfe5dcb84c2fbe798
22 files changed
+262
-67
pnpm-lock.yaml
+7
-7
@@ -25,8 +25,8 @@ catalogs:
25
specifier: ^4.20250917.0
26
version: 4.20260218.0
27
'@composio/client':
28
- specifier: 0.1.0-alpha.68
29
- version: 0.1.0-alpha.68
28
+ specifier: 0.1.0-alpha.69
29
+ version: 0.1.0-alpha.69
30
'@effect/cli':
31
specifier: ^0.73.2
32
version: 0.73.2
@@ -1079,7 +1079,7 @@ importers:
1079
version: link:../cli-local-tools
1080
'@composio/client':
1081
specifier: 'catalog:'
1082
- version: 0.1.0-alpha.68
1082
+ version: 0.1.0-alpha.69
1083
'@composio/core':
1084
specifier: workspace:*
1085
version: link:../core
@@ -1243,7 +1243,7 @@ importers:
1243
dependencies:
1244
'@composio/client':
1245
specifier: 'catalog:'
1246
- version: 0.1.0-alpha.68
1246
+ version: 0.1.0-alpha.69
1247
'@composio/json-schema-to-zod':
1248
specifier: workspace:*
1249
version: link:../json-schema-to-zod
@@ -1906,8 +1906,8 @@ packages:
1906
resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==}
1907
engines: {node: '>=0.1.90'}
1908
1909
- '@composio/client@0.1.0-alpha.68':
1910
- resolution: {integrity: sha512-hym21PsIELzlF0Fc9RASr3PfGR1alpGE8IlbRJU3ED6UllMZz7VzREsKUZfojG4yHjZMBlVXG5QGMBzuPEue3Q==}
1909
+ '@composio/client@0.1.0-alpha.69':
1910
+ resolution: {integrity: sha512-DMqjIrDbKJaIimuaC4iPDmIbYlcHcXY2LcjTr0hgP+bq0NiN0vzasrK9pwWdGwMEExpGXBHeAff3VvJvpY/r5w==}
1911
1912
'@cspotcode/source-map-support@0.8.1':
1913
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
@@ -7274,7 +7274,7 @@ snapshots:
7274
'@colors/colors@1.5.0':
7275
optional: true
7276
7277
- '@composio/client@0.1.0-alpha.68': {}
7277
+ '@composio/client@0.1.0-alpha.69': {}
7278
7279
'@cspotcode/source-map-support@0.8.1':
7280
dependencies:
pnpm-workspace.yaml
+1
-1
@@ -22,7 +22,7 @@ catalog:
22
'@clack/prompts': '^1.0.1'
23
'@cloudflare/vitest-pool-workers': ^0.9.2
24
'@cloudflare/workers-types': ^4.20250917.0
25
- '@composio/client': 0.1.0-alpha.68
25
+ '@composio/client': 0.1.0-alpha.69
26
'@effect/cli': ^0.73.2
27
'@effect/eslint-plugin': ^0.3.2
28
'@effect/language-service': ^0.74.0
python/composio/core/models/tools.py
+17
-3
@@ -40,6 +40,8 @@ from ._modifiers import (
40
schema_modifier,
41
)
42
43
+TOOL_ROUTER_SESSION_TOOLS_PAGE_LIMIT = 500
44
+
45
46
def _needs_serialization(obj: t.Any) -> bool:
47
"""Check if an object contains any Pydantic model instances."""
@@ -275,9 +277,21 @@ class Tools(Resource, t.Generic[TTool, TToolCollection]):
277
```
278
"""
279
# Fetch session tools from the API
278
- tools_response = self._client.tool_router.session.tools(session_id=session_id)
279
- # Cast to Tool type - session.tools returns compatible Item type from different response schema
280
- tools_list: t.List[Tool] = [t.cast(Tool, item) for item in tools_response.items]
280
+ tools_list: t.List[Tool] = []
281
+ cursor: t.Optional[str] = None
282
+
283
+ while True:
284
+ tools_response = self._client.tool_router.session.tools(
285
+ session_id=session_id,
286
+ cursor=none_to_omit(cursor),
287
+ limit=TOOL_ROUTER_SESSION_TOOLS_PAGE_LIMIT,
288
+ )
289
+ # Cast to Tool type - session.tools returns compatible Item type from different response schema
290
+ tools_list.extend(t.cast(Tool, item) for item in tools_response.items)
291
+
292
+ cursor = getattr(tools_response, "next_cursor", None)
293
+ if not cursor:
294
+ break
295
296
# Apply schema modifiers if provided
297
if modifiers is not None:
python/pyproject.toml
+1
-1
@@ -7,7 +7,7 @@ requires-python = ">=3.10,<4"
7
dependencies = [
8
"pysher>=1.0.8",
9
"pydantic>=2.6.4",
10
- "composio-client==1.35.0",
10
+ "composio-client==1.36.0",
11
"typing-extensions>=4.0.0",
12
"openai",
13
"json-schema-to-pydantic>=0.4.8",
python/setup.py
+1
-1
@@ -25,7 +25,7 @@ setup(
25
install_requires=[
26
"pysher>=1.0.8",
27
"pydantic>=2.6.4",
28
- "composio-client==1.35.0",
28
+ "composio-client==1.36.0",
29
"typing-extensions>=4.0.0",
30
"openai",
31
"json-schema-to-pydantic>=0.4.8",
python/tests/test_tool_execution.py
+30
@@ -5,6 +5,7 @@ from unittest.mock import Mock, patch
5
6
import pytest
7
from pydantic import BaseModel, RootModel
8
+from composio_client import omit
9
10
from composio.client.types import Tool, tool_list_response
11
from composio.core.models.base import allow_tracking
@@ -49,6 +50,35 @@ class TestToolExecution:
50
tags=[],
51
)
52
53
+ def test_get_raw_tool_router_meta_tools_fetches_all_pages(self):
54
+ """Test that ToolRouter session tools are fetched across all pages."""
55
+ mock_client = Mock()
56
+ mock_provider = Mock()
57
+ tools = Tools(client=mock_client, provider=mock_provider)
58
+
59
+ first_tool = self.create_mock_tool("FIRST_TOOL", "github")
60
+ second_tool = self.create_mock_tool("SECOND_TOOL", "slack")
61
+ first_response = Mock(items=[first_tool], next_cursor="next_page")
62
+ second_response = Mock(items=[second_tool], next_cursor=None)
63
+ mock_client.tool_router.session.tools.side_effect = [
64
+ first_response,
65
+ second_response,
66
+ ]
67
+
68
+ result = tools.get_raw_tool_router_meta_tools("session_123")
69
+
70
+ assert [tool.slug for tool in result] == ["FIRST_TOOL", "SECOND_TOOL"]
71
+ mock_client.tool_router.session.tools.assert_any_call(
72
+ session_id="session_123",
73
+ cursor=omit,
74
+ limit=500,
75
+ )
76
+ mock_client.tool_router.session.tools.assert_any_call(
77
+ session_id="session_123",
78
+ limit=500,
79
+ cursor="next_page",
80
+ )
81
+
82
def test_tool_execution_uses_toolkit_version(self):
83
"""Test that tool execution resolves toolkit version correctly."""
84
# Mock client and provider
ts/e2e-tests/cli/toolkits/info/e2e.test.ts
+2
-4
@@ -149,10 +149,8 @@ e2e(import.meta.url, {
149
150
describe('mock API usage', () => {
151
it('requests the detailed toolkit route for known and unknown slugs', () => {
152
- expect(server.requests).toContain('GET /api/v3/toolkits/gmail');
153
- expect(server.requests).toContain(
154
- 'GET /api/v3/toolkits/nonexistent_toolkit_xyz12345'
155
- );
152
+ expect(server.requests).toContain('GET /api/v3.1/toolkits/gmail');
153
+ expect(server.requests).toContain('GET /api/v3.1/toolkits/nonexistent_toolkit_xyz12345');
154
});
155
});
156
},
ts/e2e-tests/cli/toolkits/list/e2e.test.ts
+7
-10
@@ -5,12 +5,7 @@
5
* supports deterministic `--query` filtering, and respects `--limit`.
6
*/
7
8
-import {
9
- e2e,
10
- sanitizeOutput,
11
- parseJsonStdout,
12
- type E2ETestResult,
13
-} from '@e2e-tests/utils';
8
+import { e2e, sanitizeOutput, parseJsonStdout, type E2ETestResult } from '@e2e-tests/utils';
9
import { TIMEOUTS } from '@e2e-tests/utils/const';
10
import { afterAll, beforeAll, describe, expect, it } from 'bun:test';
11
import {
@@ -39,7 +34,9 @@ e2e(import.meta.url, {
34
35
exactResult = await runCmd(`${envPrefix} composio dev toolkits list --query gmail --limit 1`);
36
prefixResult = await runCmd(`${envPrefix} composio dev toolkits list --query gmai --limit 1`);
42
- noFuzzyResult = await runCmd(`${envPrefix} composio dev toolkits list --query gmal --limit 1`);
37
+ noFuzzyResult = await runCmd(
38
+ `${envPrefix} composio dev toolkits list --query gmal --limit 1`
39
+ );
40
}, TIMEOUTS.FIXTURE);
41
42
afterAll(async () => {
@@ -117,9 +114,9 @@ e2e(import.meta.url, {
114
115
describe('mock API usage', () => {
116
it('requests the toolkit catalog for each search term', () => {
120
- expect(server.requests).toContain('GET /api/v3/toolkits?search=gmail&limit=1');
121
- expect(server.requests).toContain('GET /api/v3/toolkits?search=gmai&limit=1');
122
- expect(server.requests).toContain('GET /api/v3/toolkits?search=gmal&limit=1');
117
+ expect(server.requests).toContain('GET /api/v3.1/toolkits?search=gmail&limit=1');
118
+ expect(server.requests).toContain('GET /api/v3.1/toolkits?search=gmai&limit=1');
119
+ expect(server.requests).toContain('GET /api/v3.1/toolkits?search=gmal&limit=1');
120
});
121
});
122
},
ts/e2e-tests/cli/toolkits/search/e2e.test.ts
+3
-3
@@ -144,10 +144,10 @@ e2e(import.meta.url, {
144
145
describe('mock API usage', () => {
146
it('requests the toolkit catalog for each search scenario', () => {
147
- expect(server.requests).toContain('GET /api/v3/toolkits?search=gmail&limit=10');
148
- expect(server.requests).toContain('GET /api/v3/toolkits?search=gmail&limit=1');
147
+ expect(server.requests).toContain('GET /api/v3.1/toolkits?search=gmail&limit=10');
148
+ expect(server.requests).toContain('GET /api/v3.1/toolkits?search=gmail&limit=1');
149
expect(server.requests).toContain(
150
- 'GET /api/v3/toolkits?search=xyznonexistent_abc_12345&limit=10'
150
+ 'GET /api/v3.1/toolkits?search=xyznonexistent_abc_12345&limit=10'
151
);
152
});
153
});
ts/packages/cli/scripts/mock-toolkits-server.ts
+13
-3
@@ -96,7 +96,10 @@ export async function startMockToolkitsListServer(options?: {
96
const url = new URL(req.url ?? '/', `http://${req.headers.host ?? '127.0.0.1'}`);
97
requests.push(`${req.method ?? 'GET'} ${url.pathname}${url.search}`);
98
99
- if ((req.method ?? 'GET') === 'GET' && url.pathname === '/api/v3/toolkits') {
99
+ if (
100
+ (req.method ?? 'GET') === 'GET' &&
101
+ (url.pathname === '/api/v3/toolkits' || url.pathname === '/api/v3.1/toolkits')
102
+ ) {
103
const items = matchingToolkits(url.searchParams.get('search')).slice(0, parseLimit(req));
104
sendJson(res, 200, {
105
items,
@@ -108,12 +111,19 @@ export async function startMockToolkitsListServer(options?: {
111
return;
112
}
113
111
- if ((req.method ?? 'GET') === 'GET' && url.pathname === '/api/v3/toolkits/gmail') {
114
+ if (
115
+ (req.method ?? 'GET') === 'GET' &&
116
+ (url.pathname === '/api/v3/toolkits/gmail' || url.pathname === '/api/v3.1/toolkits/gmail')
117
+ ) {
118
sendJson(res, 200, GMAIL_TOOLKIT_DETAILED);
119
return;
120
}
121
116
- if ((req.method ?? 'GET') === 'GET' && url.pathname.startsWith('/api/v3/toolkits/')) {
122
+ if (
123
+ (req.method ?? 'GET') === 'GET' &&
124
+ (url.pathname.startsWith('/api/v3/toolkits/') ||
125
+ url.pathname.startsWith('/api/v3.1/toolkits/'))
126
+ ) {
127
sendJson(res, 404, {
128
error: `Toolkit not found: ${url.pathname.split('/').at(-1) ?? 'unknown'}`,
129
});
ts/packages/cli/test/src/commands/connected-accounts/connected-accounts.link.cmd.test.ts
+6
-1
@@ -82,7 +82,12 @@ 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', preload: { tools: [] } },
85
+ config: {
86
+ user_id: 'consumer-user-org_test',
87
+ execute: {},
88
+ search: {},
89
+ preload: { tools: [] },
90
+ },
91
config_version: 1,
92
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
93
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS', 'COMPOSIO_MANAGE_CONNECTIONS'],
ts/packages/cli/test/src/commands/proxy.cmd.test.ts
+12
-2
@@ -56,7 +56,12 @@ describe('CLI: composio proxy', () => {
56
createParams = params;
57
return {
58
session_id: 'trs_proxy_test',
59
- config: { user_id: params.user_id, preload: { tools: [] } },
59
+ config: {
60
+ user_id: params.user_id,
61
+ execute: {},
62
+ search: {},
63
+ preload: { tools: [] },
64
+ },
65
config_version: 1,
66
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
67
tool_router_tools: [],
@@ -142,7 +147,12 @@ describe('CLI: composio proxy', () => {
147
createCalled = true;
148
return {
149
session_id: 'trs_proxy_test',
145
- config: { user_id: 'global_test_user_id', preload: { tools: [] } },
150
+ config: {
151
+ user_id: 'global_test_user_id',
152
+ execute: {},
153
+ search: {},
154
+ preload: { tools: [] },
155
+ },
156
config_version: 1,
157
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
158
tool_router_tools: [],
ts/packages/cli/test/src/commands/tools/tools.execute.cmd.test.ts
+24
-4
@@ -188,7 +188,12 @@ 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, preload: { tools: [] } },
191
+ config: {
192
+ user_id: params.user_id,
193
+ execute: {},
194
+ search: {},
195
+ preload: { tools: [] },
196
+ },
197
config_version: 1,
198
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
199
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS', 'COMPOSIO_MANAGE_CONNECTIONS'],
@@ -271,7 +276,12 @@ describe('CLI: composio execute', () => {
276
recordedSessionCreateParams.push(params as unknown as Record<string, unknown>);
277
return {
278
session_id: 'trs_gmail_explicit_session',
274
- config: { user_id: params.user_id, preload: { tools: [] } },
279
+ config: {
280
+ user_id: params.user_id,
281
+ execute: {},
282
+ search: {},
283
+ preload: { tools: [] },
284
+ },
285
config_version: 1,
286
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
287
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS', 'COMPOSIO_MANAGE_CONNECTIONS'],
@@ -335,7 +345,12 @@ describe('CLI: composio execute', () => {
345
recordedSessionCreateParams.push(params as unknown as Record<string, unknown>);
346
return {
347
session_id: 'trs_posthog_test_session',
338
- config: { user_id: params.user_id, preload: { tools: [] } },
348
+ config: {
349
+ user_id: params.user_id,
350
+ execute: {},
351
+ search: {},
352
+ preload: { tools: [] },
353
+ },
354
config_version: 1,
355
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
356
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS', 'COMPOSIO_MANAGE_CONNECTIONS'],
@@ -387,7 +402,12 @@ describe('CLI: composio execute', () => {
402
recordedSessionCreateParams.push(params as unknown as Record<string, unknown>);
403
return {
404
session_id: 'trs_posthog_cached_session',
390
- config: { user_id: params.user_id, preload: { tools: [] } },
405
+ config: {
406
+ user_id: params.user_id,
407
+ execute: {},
408
+ search: {},
409
+ preload: { tools: [] },
410
+ },
411
config_version: 1,
412
mcp: { type: 'http' as const, url: 'https://mcp.test.composio.dev' },
413
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS', 'COMPOSIO_MANAGE_CONNECTIONS'],
ts/packages/cli/test/src/commands/tools/tools.search.cmd.test.ts
+18
-3
@@ -384,7 +384,12 @@ describe('CLI: composio search', () => {
384
createParams = params;
385
return {
386
session_id: 'trs_test_session',
387
- config: { user_id: params.user_id, preload: { tools: [] } },
387
+ config: {
388
+ user_id: params.user_id,
389
+ execute: {},
390
+ search: {},
391
+ preload: { tools: [] },
392
+ },
393
config_version: 1,
394
mcp: { type: 'http', url: 'https://mcp.test.composio.dev' },
395
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS'],
@@ -464,7 +469,12 @@ describe('CLI: composio search', () => {
469
createParams = params;
470
return {
471
session_id: 'trs_test_session',
467
- config: { user_id: params.user_id, preload: { tools: [] } },
472
+ config: {
473
+ user_id: params.user_id,
474
+ execute: {},
475
+ search: {},
476
+ preload: { tools: [] },
477
+ },
478
config_version: 1,
479
mcp: { type: 'http', url: 'https://mcp.test.composio.dev' },
480
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS'],
@@ -652,7 +662,12 @@ describe('CLI: composio search', () => {
662
createParams = params;
663
return {
664
session_id: 'trs_test_session',
655
- config: { user_id: params.user_id, preload: { tools: [] } },
665
+ config: {
666
+ user_id: params.user_id,
667
+ execute: {},
668
+ search: {},
669
+ preload: { tools: [] },
670
+ },
671
config_version: 1,
672
mcp: { type: 'http', url: 'https://mcp.test.composio.dev' },
673
tool_router_tools: ['COMPOSIO_SEARCH_TOOLS'],
ts/packages/core/src/models/ConnectionRequest.ts
+25
-17
@@ -73,12 +73,36 @@ export function createConnectionRequest(
73
async function waitForConnection(
74
timeout: number = 60000
75
): Promise<ConnectedAccountRetrieveResponse> {
76
+ const terminalErrorStates: ConnectedAccountStatus[] = [
77
+ ConnectedAccountStatuses.FAILED,
78
+ ConnectedAccountStatuses.EXPIRED,
79
+ ConnectedAccountStatuses.REVOKED,
80
+ ];
81
+ const failIfTerminal = (response: {
82
+ status: ConnectedAccountStatus;
83
+ status_reason?: string | null;
84
+ }) => {
85
+ if (terminalErrorStates.includes(response.status)) {
86
+ throw new ConnectionRequestFailedError(
87
+ `Connection request failed with status: ${response.status}${response.status_reason ? `, reason: ${response.status_reason}` : ''}`,
88
+ {
89
+ meta: {
90
+ connectedAccountId: state.id,
91
+ status: response.status,
92
+ statusReason: response.status_reason,
93
+ },
94
+ }
95
+ );
96
+ }
97
+ };
98
+
99
try {
100
const response = await client.connectedAccounts.retrieve(state.id);
101
if (response.status === ConnectedAccountStatuses.ACTIVE) {
102
state.status = ConnectedAccountStatuses.ACTIVE;
103
return transformConnectedAccountResponse(response);
104
}
105
+ failIfTerminal(response);
106
} catch (error) {
107
if (error instanceof ComposioClient.NotFoundError) {
108
throw new ComposioConnectedAccountNotFoundError(
@@ -94,11 +118,6 @@ export function createConnectionRequest(
118
}
119
}
120
97
- const terminalErrorStates: ConnectedAccountStatus[] = [
98
- ConnectedAccountStatuses.FAILED,
99
- ConnectedAccountStatuses.EXPIRED,
100
- ];
101
-
121
const start = Date.now();
122
const pollInterval = 1000;
123
@@ -111,18 +130,7 @@ export function createConnectionRequest(
130
return transformConnectedAccountResponse(response);
131
}
132
114
- if (terminalErrorStates.includes(response.status)) {
115
- throw new ConnectionRequestFailedError(
116
- `Connection request failed with status: ${response.status}${response.status_reason ? `, reason: ${response.status_reason}` : ''}`,
117
- {
118
- meta: {
119
- connectedAccountId: state.id,
120
- status: response.status,
121
- statusReason: response.status_reason,
122
- },
123
- }
124
- );
125
- }
133
+ failIfTerminal(response);
134
135
await new Promise(resolve => setTimeout(resolve, pollInterval));
136
} catch (error) {
ts/packages/core/src/models/Tools.ts
+15
-2
@@ -59,6 +59,8 @@ import { CONFIG_DEFAULTS } from '../utils/config-defaults';
59
import { resolveEffectiveUploadAllowlist } from '../utils/fileDirs';
60
import { schemaHasFileUploadable } from '../utils/modifiers/FileToolModifier.utils.neutral';
61
62
+const TOOL_ROUTER_SESSION_TOOLS_PAGE_LIMIT = 500;
63
+
64
/**
65
* This class is used to manage tools in the Composio SDK.
66
* It provides methods to list, get, and execute tools.
@@ -487,8 +489,19 @@ export class Tools<
489
sessionId: string,
490
options?: SchemaModifierOptions
491
): Promise<ToolList> {
490
- const tools = await this.client.toolRouter.session.tools(sessionId);
491
- let modifiedTools = tools.items.map(tool => this.transformToolCases(tool));
492
+ const tools: ToolList = [];
493
+ let cursor: string | null | undefined;
494
+
495
+ do {
496
+ const response = await this.client.toolRouter.session.tools(sessionId, {
497
+ limit: TOOL_ROUTER_SESSION_TOOLS_PAGE_LIMIT,
498
+ ...(cursor ? { cursor } : {}),
499
+ });
500
+ tools.push(...response.items.map(tool => this.transformToolCases(tool)));
501
+ cursor = response.next_cursor;
502
+ } while (cursor);
503
+
504
+ let modifiedTools = tools;
505
// apply local modifiers if they are provided
506
if (options?.modifySchema) {
507
const modifier = options.modifySchema;
ts/packages/core/src/types/connectedAccounts.types.ts
+2
@@ -12,6 +12,7 @@ export const ConnectedAccountStatuses = {
12
FAILED: 'FAILED',
13
EXPIRED: 'EXPIRED',
14
INACTIVE: 'INACTIVE',
15
+ REVOKED: 'REVOKED',
16
} as const;
17
export const ConnectedAccountStatusSchema = z.enum([
18
ConnectedAccountStatuses.INITIALIZING,
@@ -20,6 +21,7 @@ export const ConnectedAccountStatusSchema = z.enum([
21
ConnectedAccountStatuses.FAILED,
22
ConnectedAccountStatuses.EXPIRED,
23
ConnectedAccountStatuses.INACTIVE,
24
+ ConnectedAccountStatuses.REVOKED,
25
]);
26
export type ConnectedAccountStatus =
27
(typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
ts/packages/core/test/connectedAccounts/connectedAccounts.test.ts
+27
@@ -594,6 +594,33 @@ describe('ConnectedAccounts', () => {
594
expect(result.wordId).toBe('castle');
595
expect(result.alias).toBe('Work Gmail');
596
});
597
+
598
+ it('should accept revoked connected account status from the generated client', async () => {
599
+ const nanoid = 'conn_revoked';
600
+ const mockResponse = {
601
+ id: nanoid,
602
+ status: ConnectedAccountStatuses.REVOKED,
603
+ auth_config: {
604
+ id: 'test-auth-config',
605
+ is_composio_managed: true,
606
+ is_disabled: false,
607
+ },
608
+ is_disabled: false,
609
+ created_at: '2023-01-01T00:00:00Z',
610
+ updated_at: '2023-01-01T00:00:00Z',
611
+ status_reason: 'revoked by user',
612
+ toolkit: {
613
+ slug: 'gmail',
614
+ },
615
+ };
616
+
617
+ extendedMockClient.connectedAccounts.retrieve.mockResolvedValueOnce(mockResponse);
618
+
619
+ const result = await connectedAccounts.get(nanoid);
620
+
621
+ expect(result.status).toBe(ConnectedAccountStatuses.REVOKED);
622
+ expect(result.statusReason).toBe('revoked by user');
623
+ });
624
});
625
626
describe('delete', () => {
ts/packages/core/test/connectedAccounts/connectionRequest.test.ts
+21
-1
@@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
2
import { createConnectionRequest } from '../../src/models/ConnectionRequest';
3
import { ConnectionRequest } from '../../src/types/connectionRequest.types';
4
import ComposioClient, { ComposioError } from '@composio/client';
5
-import { ConnectionRequestTimeoutError } from '../../src/errors';
5
+import { ConnectionRequestFailedError, ConnectionRequestTimeoutError } from '../../src/errors';
6
import { ConnectedAccountStatuses } from '../../src/types/connectedAccounts.types';
7
import { AuthSchemeTypes } from '../../src/types/authConfigs.types';
8
@@ -223,6 +223,26 @@ describe('ConnectionRequest', () => {
223
// Now check for the rejection
224
await expect(connectionPromise).rejects.toBe(apiError);
225
});
226
+
227
+ it('should fail when the connection is revoked while polling', async () => {
228
+ connectionRequest = createConnectionRequest(
229
+ mockClient as unknown as ComposioClient,
230
+ connectedAccountId,
231
+ ConnectedAccountStatuses.INITIATED,
232
+ redirectUrl
233
+ );
234
+
235
+ const revokedResponse = {
236
+ id: connectedAccountId,
237
+ status: ConnectedAccountStatuses.REVOKED,
238
+ status_reason: 'revoked by user',
239
+ };
240
+ mockClient.connectedAccounts.retrieve.mockResolvedValueOnce(revokedResponse);
241
+
242
+ await expect(connectionRequest.waitForConnection(3000)).rejects.toThrow(
243
+ ConnectionRequestFailedError
244
+ );
245
+ });
246
});
247
248
describe('serialization methods', () => {
ts/packages/core/test/tools/tools.test.ts
+25
@@ -355,6 +355,31 @@ describe('Tools', () => {
355
});
356
});
357
358
+ describe('getRawToolRouterSessionTools', () => {
359
+ it('should fetch all paginated session tool pages', async () => {
360
+ mockClient.toolRouter.session.tools
361
+ .mockResolvedValueOnce({
362
+ items: [{ ...toolMocks.rawTool, slug: 'FIRST_TOOL' }],
363
+ next_cursor: 'next_page',
364
+ })
365
+ .mockResolvedValueOnce({
366
+ items: [{ ...toolMocks.rawTool, slug: 'SECOND_TOOL' }],
367
+ next_cursor: null,
368
+ });
369
+
370
+ const result = await context.tools.getRawToolRouterSessionTools('session_123');
371
+
372
+ expect(result.map(tool => tool.slug)).toEqual(['FIRST_TOOL', 'SECOND_TOOL']);
373
+ expect(mockClient.toolRouter.session.tools).toHaveBeenNthCalledWith(1, 'session_123', {
374
+ limit: 500,
375
+ });
376
+ expect(mockClient.toolRouter.session.tools).toHaveBeenNthCalledWith(2, 'session_123', {
377
+ limit: 500,
378
+ cursor: 'next_page',
379
+ });
380
+ });
381
+ });
382
+
383
describe('getRawComposioToolBySlug', () => {
384
it('should fetch a tool by slug from the API', async () => {
385
const slug = 'TOOL_SLUG';
ts/packages/core/test/utils/mocks/client.mock.ts
+1
@@ -19,6 +19,7 @@ export const mockClient = {
19
toolRouter: {
20
session: {
21
execute: vi.fn(),
22
+ tools: vi.fn(),
23
},
24
},
25
};
uv.lock
+4
-4
@@ -621,7 +621,7 @@ dev = [
621
622
[package.metadata]
623
requires-dist = [
624
- { name = "composio-client", specifier = "==1.35.0" },
624
+ { name = "composio-client", specifier = "==1.36.0" },
625
{ name = "json-schema-to-pydantic", specifier = ">=0.4.8" },
626
{ name = "openai" },
627
{ name = "pydantic", specifier = ">=2.6.4" },
@@ -663,7 +663,7 @@ requires-dist = [
663
664
[[package]]
665
name = "composio-client"
666
-version = "1.35.0"
666
+version = "1.36.0"
667
source = { registry = "https://pypi.org/simple" }
668
dependencies = [
669
{ name = "anyio" },
@@ -673,9 +673,9 @@ dependencies = [
673
{ name = "sniffio" },
674
{ name = "typing-extensions" },
675
]
676
-sdist = { url = "https://files.pythonhosted.org/packages/d5/8c/986ba4eca8c54b4a4d684dd4b9af07f813a4d19cc0dcef6c3e150befcd5e/composio_client-1.35.0.tar.gz", hash = "sha256:05f195aec2f5706a057848c855ab31b94b00d78283dd9ed0d9a02d316f2acff8", size = 231383, upload-time = "2026-04-30T12:15:20.413Z" }
676
+sdist = { url = "https://files.pythonhosted.org/packages/3b/1c/ad526e950c1fb51ba2dc67e0467c58a8d8fd66991284c6fc8e8f08868aa9/composio_client-1.36.0.tar.gz", hash = "sha256:924e97c8e1069fb6815a382a724d9ab5992f4f393881146416eec68b66189885", size = 241263, upload-time = "2026-05-05T08:40:16.697Z" }
677
wheels = [
678
- { url = "https://files.pythonhosted.org/packages/58/a3/5d1ab2daded174b811af8ec5539ed35a1e7f8dbcd7ab47779a787487a4fb/composio_client-1.35.0-py3-none-any.whl", hash = "sha256:59b909867a098ba89f513464c0889cfcf1817c707c729faeee665b5b2590e557", size = 257695, upload-time = "2026-04-30T12:15:18.76Z" },
678
+ { url = "https://files.pythonhosted.org/packages/ce/bc/f5bb734d1e6abf246130f4549de745b87ced2957839a315479cacc6d31bb/composio_client-1.36.0-py3-none-any.whl", hash = "sha256:820961ec9001b1967273970e406f8469386c71fa378a0f4dd1c36864eff8819b", size = 277167, upload-time = "2026-05-05T08:40:15.344Z" },
679
]
680
681
[[package]]