Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
test(openai): cover v6 and v7 consumers
jkomyno committed
Aug 3, 2026 at 16:52 UTC
a8d7401b73653f8abe459456ea20dd05ee70ca48
16 files changed
+326
-45
pnpm-lock.yaml
+24
-2
@@ -505,8 +505,26 @@ importers:
505
specifier: workspace:*
506
version: link:../../../_utils
507
508
+ ts/e2e-tests/runtimes/node/openai-v7-zod4-compat:
509
+ devDependencies:
510
+ '@composio/core':
511
+ specifier: workspace:*
512
+ version: link:../../../../packages/core
513
+ '@composio/openai':
514
+ specifier: workspace:*
515
+ version: link:../../../../packages/providers/openai
516
+ '@e2e-tests/utils':
517
+ specifier: workspace:*
518
+ version: link:../../../_utils
519
+
520
ts/e2e-tests/runtimes/node/openai-zod4-compat:
521
devDependencies:
522
+ '@composio/core':
523
+ specifier: workspace:*
524
+ version: link:../../../../packages/core
525
+ '@composio/openai':
526
+ specifier: workspace:*
527
+ version: link:../../../../packages/providers/openai
528
'@e2e-tests/utils':
529
specifier: workspace:*
530
version: link:../../../_utils
@@ -7802,6 +7820,10 @@ snapshots:
7820
dependencies:
7821
hono: 4.12.31
7822
7823
+ '@hono/node-server@2.0.11(hono@4.12.33)':
7824
+ dependencies:
7825
+ hono: 4.12.33
7826
+
7827
'@img/colour@1.1.0': {}
7828
7829
'@img/sharp-darwin-arm64@0.33.5':
@@ -8473,7 +8495,7 @@ snapshots:
8495
8496
'@modelcontextprotocol/sdk@1.30.0(@cfworker/json-schema@4.1.1)(zod@4.4.3)':
8497
dependencies:
8476
- '@hono/node-server': 2.0.11(hono@4.12.31)
8498
+ '@hono/node-server': 2.0.11(hono@4.12.33)
8499
ajv: 8.20.0
8500
ajv-formats: 3.0.1(ajv@8.20.0)
8501
content-type: 1.0.5
@@ -8483,7 +8505,7 @@ snapshots:
8505
eventsource-parser: 3.1.0
8506
express: 5.2.1
8507
express-rate-limit: 8.6.0(express@5.2.1)
8486
- hono: 4.12.31
8508
+ hono: 4.12.33
8509
jose: 6.2.4
8510
json-schema-typed: 8.0.2
8511
pkce-challenge: 5.0.1
ts/e2e-tests/runtimes/node/openai-v7-zod4-compat/README.md
new
+16
@@ -0,0 +1,16 @@
1
+# OpenAI v7 + Zod v4 Compatibility Test
2
+
3
+Verifies that packed `@composio/core` and `@composio/openai` packages install,
4
+typecheck, and run with explicit OpenAI 7 and Zod 4 versions.
5
+
6
+The consumer typecheck covers exported Chat Completions and Responses types
7
+without `skipLibCheck`. Runtime assertions construct clients with fake keys,
8
+wrap tools through both providers, and make no network requests.
9
+
10
+The Docker matrix covers Node.js 22.22.3, 24.17.0, and 25.9.0.
11
+
12
+Run it from the repository root:
13
+
14
+```bash
15
+pnpm --filter @e2e-tests/node-openai-v7-zod4-compat test:e2e:node
16
+```
ts/e2e-tests/runtimes/node/openai-v7-zod4-compat/e2e.test.ts
new
+52
@@ -0,0 +1,52 @@
1
+/**
2
+ * Packed @composio/core and @composio/openai compatibility with OpenAI 7.
3
+ */
4
+
5
+import { e2e, type E2ETestResultWithSetup } from '@e2e-tests/utils';
6
+import { describe, it, expect, beforeAll } from 'bun:test';
7
+
8
+e2e(import.meta.url, {
9
+ versions: { node: ['22.22.3', '24.17.0', '25.9.0'] },
10
+ usesFixtures: true,
11
+ defineTests: ({ runFixture }) => {
12
+ let result: E2ETestResultWithSetup;
13
+
14
+ beforeAll(async () => {
15
+ result = await runFixture({
16
+ filename: 'index.mjs',
17
+ setup: 'npm run install:composio && npm run typecheck',
18
+ });
19
+ }, 300_000);
20
+
21
+ describe('setup', () => {
22
+ it('installs and typechecks successfully', () => {
23
+ expect(result.setup.exitCode).toBe(0);
24
+ expect(result.setup.stdout).toContain('openai v7 compatibility typecheck passed');
25
+ });
26
+ });
27
+
28
+ describe('OpenAI v7 + Zod v4 compatibility', () => {
29
+ it('exits successfully', () => {
30
+ expect(result.exitCode).toBe(0);
31
+ });
32
+
33
+ it('loads OpenAI 7 and Zod 4', () => {
34
+ expect(result.stdout).toContain('zod@4 works');
35
+ expect(result.stdout).toContain('openai@7 works');
36
+ });
37
+
38
+ it('constructs the Composio client', () => {
39
+ expect(result.stdout).toContain('@composio/core works');
40
+ });
41
+
42
+ it('wraps tools through both providers', () => {
43
+ expect(result.stdout).toContain('core wrapTool works');
44
+ expect(result.stdout).toContain('responses wrapTool works');
45
+ });
46
+
47
+ it('runs without network access', () => {
48
+ expect(result.stdout).toContain('All packages work together!');
49
+ });
50
+ });
51
+ },
52
+});
ts/e2e-tests/runtimes/node/openai-v7-zod4-compat/fixtures/index.mjs
new
+45
@@ -0,0 +1,45 @@
1
+import { z } from 'zod';
2
+import OpenAI from 'openai';
3
+import { Composio, OpenAIProvider } from '@composio/core';
4
+import { OpenAIResponsesProvider } from '@composio/openai';
5
+
6
+const schema = z.object({ name: z.string() });
7
+schema.parse({ name: 'OpenAI 7' });
8
+console.log('zod@4 works');
9
+
10
+const openai = new OpenAI({ apiKey: 'test-key' });
11
+if (!openai.responses) {
12
+ throw new Error('OpenAI client does not expose the Responses API');
13
+}
14
+console.log('openai@7 works');
15
+
16
+const chatProvider = new OpenAIProvider();
17
+const composio = new Composio({
18
+ provider: chatProvider,
19
+ apiKey: 'test-key',
20
+});
21
+if (!composio) {
22
+ throw new Error('Composio client construction failed');
23
+}
24
+console.log('@composio/core works');
25
+
26
+const composioTool = {
27
+ slug: 'TEST',
28
+ description: 'Test tool',
29
+ inputParameters: { type: 'object', properties: {} },
30
+};
31
+
32
+const chatTool = chatProvider.wrapTool(composioTool);
33
+if (chatTool.type !== 'function' || chatTool.function.name !== 'TEST') {
34
+ throw new Error('Core OpenAI provider returned an invalid tool');
35
+}
36
+console.log('core wrapTool works');
37
+
38
+const responsesProvider = new OpenAIResponsesProvider();
39
+const responsesTool = responsesProvider.wrapTool(composioTool);
40
+if (responsesTool.type !== 'function' || responsesTool.name !== 'TEST') {
41
+ throw new Error('Responses provider returned an invalid tool');
42
+}
43
+console.log('responses wrapTool works');
44
+
45
+console.log('All packages work together!');
ts/e2e-tests/runtimes/node/openai-v7-zod4-compat/fixtures/index.ts
new
+31
@@ -0,0 +1,31 @@
1
+import OpenAI from 'openai';
2
+import { OpenAIProvider, type Tool } from '@composio/core';
3
+import { OpenAIResponsesProvider } from '@composio/openai';
4
+
5
+const composioTool = {
6
+ slug: 'TEST_TOOL',
7
+ name: 'Test Tool',
8
+ description: 'A tool used by the OpenAI compatibility fixture',
9
+ version: '20260625_00',
10
+ availableVersions: ['20260625_00'],
11
+ inputParameters: {
12
+ type: 'object',
13
+ properties: {
14
+ query: { type: 'string' },
15
+ },
16
+ required: ['query'],
17
+ },
18
+ tags: [],
19
+} satisfies Tool;
20
+
21
+const chatProvider = new OpenAIProvider();
22
+const chatTool = chatProvider.wrapTool(composioTool);
23
+const _openAIChatTool: OpenAI.ChatCompletionTool = chatTool;
24
+
25
+const responsesProvider = new OpenAIResponsesProvider();
26
+const responsesTool = responsesProvider.wrapTool(composioTool);
27
+const _openAIResponsesTool: OpenAI.Responses.FunctionTool = responsesTool;
28
+
29
+type ProviderToolCall = Parameters<OpenAIResponsesProvider['executeToolCall']>[1];
30
+declare const openAIToolCall: OpenAI.Responses.ResponseFunctionToolCall;
31
+const _providerToolCall: ProviderToolCall = openAIToolCall;
ts/e2e-tests/runtimes/node/openai-v7-zod4-compat/fixtures/package.json
new
+13
@@ -0,0 +1,13 @@
1
+{
2
+ "private": true,
3
+ "type": "module",
4
+ "scripts": {
5
+ "install:composio": "pnpm --dir /app/ts/packages/core pack --pack-destination . --silent >/dev/null && pnpm --dir /app/ts/packages/providers/openai pack --pack-destination . --silent >/dev/null && npm install --ignore-scripts --package-lock=false ./composio-core-*.tgz ./composio-openai-*.tgz",
6
+ "typecheck": "tsc --noEmit && echo openai v7 compatibility typecheck passed"
7
+ },
8
+ "dependencies": {
9
+ "openai": "7.2.0",
10
+ "typescript": "5.8.3",
11
+ "zod": "4.4.3"
12
+ }
13
+}
ts/e2e-tests/runtimes/node/openai-v7-zod4-compat/fixtures/tsconfig.json
new
+12
@@ -0,0 +1,12 @@
1
+{
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "es2022",
5
+ "module": "nodenext",
6
+ "moduleResolution": "nodenext",
7
+ "strict": true,
8
+ "skipLibCheck": false,
9
+ "noEmit": true
10
+ },
11
+ "include": ["index.ts"]
12
+}
ts/e2e-tests/runtimes/node/openai-v7-zod4-compat/package.json
new
+16
@@ -0,0 +1,16 @@
1
+{
2
+ "name": "@e2e-tests/node-openai-v7-zod4-compat",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "typecheck": "tsc --noEmit",
8
+ "test:e2e": "bun test e2e.test.ts",
9
+ "test:e2e:node": "bun test e2e.test.ts"
10
+ },
11
+ "devDependencies": {
12
+ "@composio/core": "workspace:*",
13
+ "@composio/openai": "workspace:*",
14
+ "@e2e-tests/utils": "workspace:*"
15
+ }
16
+}
ts/e2e-tests/runtimes/node/openai-v7-zod4-compat/tsconfig.json
new
+12
@@ -0,0 +1,12 @@
1
+{
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "es2022",
5
+ "module": "esnext",
6
+ "moduleResolution": "bundler",
7
+ "strict": true,
8
+ "skipLibCheck": true,
9
+ "noEmit": true
10
+ },
11
+ "include": ["e2e.test.ts"]
12
+}
ts/e2e-tests/runtimes/node/openai-zod4-compat/README.md
+17
-15
@@ -1,6 +1,7 @@
1
-# OpenAI + Zod v4 Compatibility Test
1
+# OpenAI v6 + Zod v4 Compatibility Test
2
3
-Verifies that `@composio/core` works correctly with `openai` and `zod@4`.
3
+Verifies that packed `@composio/core` and `@composio/openai` packages work with
4
+`openai@6` and `zod@4`.
5
6
## Background
7
@@ -8,29 +9,30 @@ Issue [#2336](https://github.com/ComposioHQ/composio/issues/2336) reported peer
9
10
## What It Tests
11
11
-| Test | Description |
12
-| ------------------- | ----------------------------------------------------- |
13
-| npm install | Installs `@composio/core`, `openai`, and `zod@4` |
14
-| Package integration | Verifies all packages work together without conflicts |
15
-| wrapTool | Confirms OpenAI provider tool wrapping works |
12
+| Test | Description |
13
+| ------------------- | --------------------------------------------------------- |
14
+| npm install | Installs packed Composio packages with OpenAI 6 and Zod 4 |
15
+| TypeScript | Checks exported provider types against OpenAI 6 |
16
+| Package integration | Verifies all packages work together without conflicts |
17
+| wrapTool | Confirms both OpenAI provider surfaces wrap tools |
18
19
## Fixture
20
21
```
22
fixtures/
21
-├── index.mjs # Test script that imports and uses all packages
22
-└── package.json # Declares dependencies: @composio/core, openai@^6.16.0, zod@^4.3.5
23
+├── index.mjs # Offline runtime assertions
24
+├── index.ts # Exported-type compatibility checks
25
+├── package.json # Explicit OpenAI 6 and Zod 4 dependencies
26
+└── tsconfig.json # Strict consumer compiler settings
27
```
28
25
-The fixture uses `usesFixtures: true` with a setup phase to install dependencies at runtime:
26
-
27
-- `package.json` declares `@composio/core` (linked from monorepo), `openai`, and `zod@4`
28
-- `index.mjs` imports all three packages and verifies they work together
29
-- Tests `wrapTool` to ensure schema conversion works with Zod v4
29
+The setup phase packs both Composio packages, installs them with explicit
30
+OpenAI 6 and Zod 4 versions, and typechecks without `skipLibCheck`.
31
32
## Setup
33
33
-The `setup` phase runs `npm install --legacy-peer-deps` in a Docker volume, then the fixture runs with the installed `node_modules` mounted read-only.
34
+The runtime phase constructs clients with fake keys and never makes a network
35
+request.
36
37
## Isolation Tool
38
ts/e2e-tests/runtimes/node/openai-zod4-compat/e2e.test.ts
+9
-17
@@ -1,25 +1,16 @@
1
/**
2
* OpenAI v6 + Zod v4 compatibility e2e test
3
*
4
- * Verifies that @composio/core works correctly with openai@6 and zod@4,
5
- * specifically testing the fix for https://github.com/ComposioHQ/composio/issues/2336
4
+ * Verifies that packed @composio/core and @composio/openai packages install,
5
+ * typecheck, and run with openai@6 and zod@4.
6
*/
7
8
import { e2e, type E2ETestResultWithSetup } from '@e2e-tests/utils';
9
import { describe, it, expect, beforeAll } from 'bun:test';
10
11
-declare module 'bun' {
12
- interface Env {
13
- COMPOSIO_API_KEY: string;
14
- }
15
-}
16
-
11
e2e(import.meta.url, {
12
versions: { node: ['22.22.3', '24.17.0', '25.9.0'] },
13
usesFixtures: true,
20
- env: {
21
- COMPOSIO_API_KEY: Bun.env.COMPOSIO_API_KEY,
22
- },
14
defineTests: ({ runFixture }) => {
15
let result: E2ETestResultWithSetup;
16
@@ -27,14 +18,14 @@ e2e(import.meta.url, {
18
beforeAll(async () => {
19
result = await runFixture({
20
filename: 'index.mjs',
30
- setup: 'npm install --legacy-peer-deps',
21
+ setup: 'npm run install:composio && npm run typecheck',
22
});
23
}, 300_000);
24
25
describe('setup', () => {
35
- it('npm install completes successfully', () => {
36
- expect(result.setup.stdout).toMatch(/added \d+ packages/);
26
+ it('installs and typechecks successfully', () => {
27
expect(result.setup.exitCode).toBe(0);
28
+ expect(result.setup.stdout).toContain('openai v6 compatibility typecheck passed');
29
});
30
});
31
@@ -47,8 +38,8 @@ e2e(import.meta.url, {
38
expect(result.stdout).toContain('zod@4 works');
39
});
40
50
- it('openai@5 works', () => {
51
- expect(result.stdout).toContain('openai@5 works');
41
+ it('openai@6 works', () => {
42
+ expect(result.stdout).toContain('openai@6 works');
43
});
44
45
it('@composio/core works', () => {
@@ -56,7 +47,8 @@ e2e(import.meta.url, {
47
});
48
49
it('wrapTool works', () => {
59
- expect(result.stdout).toContain('wrapTool works');
50
+ expect(result.stdout).toContain('core wrapTool works');
51
+ expect(result.stdout).toContain('responses wrapTool works');
52
});
53
54
it('all packages work together', () => {
ts/e2e-tests/runtimes/node/openai-zod4-compat/fixtures/index.mjs
+27
-8
@@ -9,30 +9,49 @@
9
import { z } from 'zod';
10
import OpenAI from 'openai';
11
import { Composio, OpenAIProvider } from '@composio/core';
12
+import { OpenAIResponsesProvider } from '@composio/openai';
13
14
// Verify zod@4 works
15
const schema = z.object({ name: z.string() });
16
console.log('✅ zod@4 works');
17
17
-// Verify openai@6 works (note: the package says openai@5 in comments but uses ^6.16.0)
18
+// Verify openai@6 works without making a network request.
19
const openai = new OpenAI({ apiKey: 'test-key' });
19
-console.log('✅ openai@5 works');
20
+if (!openai.responses) {
21
+ throw new Error('OpenAI client does not expose the Responses API');
22
+}
23
+console.log('✅ openai@6 works');
24
25
// Verify @composio/core works
26
const provider = new OpenAIProvider();
27
const composio = new Composio({
28
provider,
25
- apiKey: process.env.COMPOSIO_API_KEY,
29
+ apiKey: 'test-key',
30
});
31
+if (!composio) {
32
+ throw new Error('Composio client construction failed');
33
+}
34
console.log('✅ @composio/core works');
35
29
-// Verify wrapTool works
30
-const _tool = provider.wrapTool({
36
+const composioTool = {
37
slug: 'TEST',
38
description: 'Test tool',
33
- inputParameters: { type: 'object', properties: {} }
34
-});
35
-console.log('✅ wrapTool works');
39
+ inputParameters: { type: 'object', properties: {} },
40
+};
41
+
42
+// Verify both published provider surfaces wrap tools without API calls.
43
+const chatTool = provider.wrapTool(composioTool);
44
+if (chatTool.type !== 'function' || chatTool.function.name !== 'TEST') {
45
+ throw new Error('Core OpenAI provider returned an invalid tool');
46
+}
47
+console.log('✅ core wrapTool works');
48
+
49
+const responsesProvider = new OpenAIResponsesProvider();
50
+const responsesTool = responsesProvider.wrapTool(composioTool);
51
+if (responsesTool.type !== 'function' || responsesTool.name !== 'TEST') {
52
+ throw new Error('Responses provider returned an invalid tool');
53
+}
54
+console.log('✅ responses wrapTool works');
55
56
console.log('\n🎉 All packages work together!');
57
process.exit(0);
ts/e2e-tests/runtimes/node/openai-zod4-compat/fixtures/index.ts
new
+31
@@ -0,0 +1,31 @@
1
+import OpenAI from 'openai';
2
+import { OpenAIProvider, type Tool } from '@composio/core';
3
+import { OpenAIResponsesProvider } from '@composio/openai';
4
+
5
+const composioTool = {
6
+ slug: 'TEST_TOOL',
7
+ name: 'Test Tool',
8
+ description: 'A tool used by the OpenAI compatibility fixture',
9
+ version: '20260625_00',
10
+ availableVersions: ['20260625_00'],
11
+ inputParameters: {
12
+ type: 'object',
13
+ properties: {
14
+ query: { type: 'string' },
15
+ },
16
+ required: ['query'],
17
+ },
18
+ tags: [],
19
+} satisfies Tool;
20
+
21
+const chatProvider = new OpenAIProvider();
22
+const chatTool = chatProvider.wrapTool(composioTool);
23
+const _openAIChatTool: OpenAI.ChatCompletionTool = chatTool;
24
+
25
+const responsesProvider = new OpenAIResponsesProvider();
26
+const responsesTool = responsesProvider.wrapTool(composioTool);
27
+const _openAIResponsesTool: OpenAI.Responses.FunctionTool = responsesTool;
28
+
29
+type ProviderToolCall = Parameters<OpenAIResponsesProvider['executeToolCall']>[1];
30
+declare const openAIToolCall: OpenAI.Responses.ResponseFunctionToolCall;
31
+const _providerToolCall: ProviderToolCall = openAIToolCall;
ts/e2e-tests/runtimes/node/openai-zod4-compat/fixtures/package.json
+7
-3
@@ -1,9 +1,13 @@
1
{
2
"private": true,
3
"type": "module",
4
+ "scripts": {
5
+ "install:composio": "pnpm --dir /app/ts/packages/core pack --pack-destination . --silent >/dev/null && pnpm --dir /app/ts/packages/providers/openai pack --pack-destination . --silent >/dev/null && npm install --ignore-scripts --package-lock=false ./composio-core-*.tgz ./composio-openai-*.tgz",
6
+ "typecheck": "tsc --noEmit && echo openai v6 compatibility typecheck passed"
7
+ },
8
"dependencies": {
5
- "@composio/core": "file:/app/ts/packages/core",
6
- "openai": "^6.16.0",
7
- "zod": "^4.3.5"
9
+ "openai": "6.49.0",
10
+ "typescript": "5.8.3",
11
+ "zod": "4.4.3"
12
}
13
}
ts/e2e-tests/runtimes/node/openai-zod4-compat/fixtures/tsconfig.json
new
+12
@@ -0,0 +1,12 @@
1
+{
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "es2022",
5
+ "module": "nodenext",
6
+ "moduleResolution": "nodenext",
7
+ "strict": true,
8
+ "skipLibCheck": false,
9
+ "noEmit": true
10
+ },
11
+ "include": ["index.ts"]
12
+}
ts/e2e-tests/runtimes/node/openai-zod4-compat/package.json
+2
@@ -9,6 +9,8 @@
9
"test:e2e:node": "bun test e2e.test.ts"
10
},
11
"devDependencies": {
12
+ "@composio/core": "workspace:*",
13
+ "@composio/openai": "workspace:*",
14
"@e2e-tests/utils": "workspace:*"
15
}
16
}