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(docs): update OpenAI Agents TS quickstart snippets
- Remove try/catch blocks - Update model from gpt-5 to gpt-5.2 - Remove redundant comments - Fix inconsistent output (console.log vs process.stdout.write) - Consistent input handling across native and MCP - Bump @openai/agents 0.3.7 → 0.4.13, @composio/openai-agents 0.5.5 → 0.6.3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmithamallesh committed
Feb 19, 2026 at 02:28 UTC
91acac7cccde34e668424a2e7b527d9deedd0ad0
3 files changed
+33
-36
docs/bun.lock
+19
-7
@@ -36,7 +36,7 @@
36
"@composio/llamaindex": "^0.5.5",
37
"@composio/mastra": "^0.5.5",
38
"@composio/openai": "^0.5.5",
39
- "@composio/openai-agents": "^0.5.5",
39
+ "@composio/openai-agents": "^0.6.3",
40
"@composio/vercel": "^0.6.3",
41
"@google/genai": "^1.35.0",
42
"@langchain/core": "^1.1.12",
@@ -45,7 +45,7 @@
45
"@llamaindex/openai": "^0.4.22",
46
"@llamaindex/workflow": "^1.1.24",
47
"@mastra/core": "1.0.0-beta.21",
48
- "@openai/agents": "^0.3.7",
48
+ "@openai/agents": "^0.4.13",
49
"@shikijs/vitepress-twoslash": "^3.21.0",
50
"@tailwindcss/postcss": "^4.1.18",
51
"@types/mdx": "^2.0.13",
@@ -176,7 +176,7 @@
176
177
"@composio/openai": ["@composio/openai@0.5.5", "", { "peerDependencies": { "@composio/core": "0.5.5", "openai": "^6.16.0" } }, "sha512-PxbV66GiTLXpzig9AqNPtKjO7R6i1LYJsofu7QGgaCio1Ndb+pqpIMZSyHg3QoSPC1LTCfe9mcIH/GAOEoOxWw=="],
178
179
- "@composio/openai-agents": ["@composio/openai-agents@0.5.5", "", { "peerDependencies": { "@composio/core": "0.5.5", "@openai/agents": "^0.1.3", "zod": "^4.1.0" } }, "sha512-s8fXolOPf+rbya312QsgNU31ly9d/2xIbRn2Ig2AKkdsIZhB5/kXh710n+pGm7ssTXFOs/Jb9/fiXD+M9PL4Ug=="],
179
+ "@composio/openai-agents": ["@composio/openai-agents@0.6.3", "", { "peerDependencies": { "@composio/core": "0.6.3", "@openai/agents": "^0.1.3", "zod": "^4.1.0" } }, "sha512-X0Xk9PXeH+VbaoiAZT5iMXF44RYT7+4uCvMSf/ydboAxh6XoObhDmtpwGy28l2YSCs6W9qtISu/VI30ytUpuPA=="],
180
181
"@composio/vercel": ["@composio/vercel@0.6.3", "", { "peerDependencies": { "@composio/core": "0.6.3", "ai": "^5.0.0 || ^6.0.0" } }, "sha512-hwtqufR2mWNwdATsRfrAuWRjPVZG4maRcqWZB4jDLpuIZU1NEBMLmL2Ae7b/QFXvNYXibA4w0Ug8XavV4Zkxlg=="],
182
@@ -420,13 +420,13 @@
420
421
"@nolyfill/is-core-module": ["@nolyfill/is-core-module@1.0.39", "", {}, "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA=="],
422
423
- "@openai/agents": ["@openai/agents@0.3.7", "", { "dependencies": { "@openai/agents-core": "0.3.7", "@openai/agents-openai": "0.3.7", "@openai/agents-realtime": "0.3.7", "debug": "^4.4.0", "openai": "^6" }, "peerDependencies": { "zod": "^3.25.40 || ^4.0" } }, "sha512-9QKr6Gqb0yy0VLsyKSjxUoHHxN8j0fqtlZ1YTNmo2j5SqRcFG5LdSVyaQbkeJ3sWsCUugCXvEBEir7yAbxjSRw=="],
423
+ "@openai/agents": ["@openai/agents@0.4.13", "", { "dependencies": { "@openai/agents-core": "0.4.13", "@openai/agents-openai": "0.4.13", "@openai/agents-realtime": "0.4.13", "debug": "^4.4.0", "openai": "^6.20.0" }, "peerDependencies": { "zod": "^4.0.0" } }, "sha512-NzvlWY1ohyMgH4QphqwgB2n3WdMzw41pWoN1i7CV8FFdLxrOD2yai3SIwLvDkJrvrOe0krl4BoZN07uzs3QK5A=="],
424
425
- "@openai/agents-core": ["@openai/agents-core@0.3.7", "", { "dependencies": { "debug": "^4.4.0", "openai": "^6" }, "optionalDependencies": { "@modelcontextprotocol/sdk": "^1.24.0" }, "peerDependencies": { "zod": "^3.25.40 || ^4.0" }, "optionalPeers": ["zod"] }, "sha512-Ya1sPc8UyHXxgQjNWN1sn/vFNP4CRdT/0SWd0tIc+kHgYuxrvRjwSfWNBqXc70XOZGS5bWWaRTqJBMwQt6AlYg=="],
425
+ "@openai/agents-core": ["@openai/agents-core@0.4.13", "", { "dependencies": { "debug": "^4.4.0", "openai": "^6.20.0" }, "optionalDependencies": { "@modelcontextprotocol/sdk": "^1.26.0" }, "peerDependencies": { "zod": "^4.0.0" }, "optionalPeers": ["zod"] }, "sha512-/tHxtkbI9btI3Rdvpct4YbCt+LrvLI1dgwtL/JpleKW6JgracsStYnKdhnNE1rtQEtZVAJWbCWRtORfvnJl9cA=="],
426
427
- "@openai/agents-openai": ["@openai/agents-openai@0.3.7", "", { "dependencies": { "@openai/agents-core": "0.3.7", "debug": "^4.4.0", "openai": "^6" }, "peerDependencies": { "zod": "^3.25.40 || ^4.0" } }, "sha512-xjFNFeKDt3TkAWfoXhvUG3sdBQJ/R3FWd/s3Dv1rt1fdcFCaS1BUKkXX1fu79oo24H5DV8zZJfuUu6Bgi0ZAHw=="],
427
+ "@openai/agents-openai": ["@openai/agents-openai@0.4.13", "", { "dependencies": { "@openai/agents-core": "0.4.13", "debug": "^4.4.0", "openai": "^6.20.0" }, "peerDependencies": { "zod": "^4.0.0" } }, "sha512-SytJPUHax1DZgl4ypMKchdtkVOkfXQaqrvYZHtQSqmGbqLL9hjs5dJENRPiJdVIZG6m2gmAJk57OCSu3V0Bs4g=="],
428
429
- "@openai/agents-realtime": ["@openai/agents-realtime@0.3.7", "", { "dependencies": { "@openai/agents-core": "0.3.7", "@types/ws": "^8.18.1", "debug": "^4.4.0", "ws": "^8.18.1" }, "peerDependencies": { "zod": "^3.25.40 || ^4.0" } }, "sha512-8zKu33Q8bmXCkReR7UOWQa1rNbIaLwqI4QgjMD20ALaEkuRglRZeaJyfVTIhTcw9COIF35uyiq+GugxFUvPE5A=="],
429
+ "@openai/agents-realtime": ["@openai/agents-realtime@0.4.13", "", { "dependencies": { "@openai/agents-core": "0.4.13", "@types/ws": "^8.18.1", "debug": "^4.4.0", "ws": "^8.18.1" }, "peerDependencies": { "zod": "^4.0.0" } }, "sha512-Zx0Qtx3tx6KRal1FNAtGAfCCUctPFgjvtYbuDblGvbkiOu25NrNNgv4MJkW4So76uffmBkSYHJgb21YfMr65nA=="],
430
431
"@opentelemetry/api": ["@opentelemetry/api@1.9.0", "", {}, "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg=="],
432
@@ -1406,6 +1406,8 @@
1406
1407
"internmap": ["internmap@2.0.3", "", {}, "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg=="],
1408
1409
+ "ip-address": ["ip-address@10.0.1", "", {}, "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA=="],
1410
+
1411
"ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="],
1412
1413
"is-alphabetical": ["is-alphabetical@2.0.1", "", {}, "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ=="],
@@ -2306,6 +2308,14 @@
2308
2309
"@mastra/mcp/uuid": ["uuid@11.1.0", "", { "bin": { "uuid": "dist/esm/bin/uuid" } }, "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A=="],
2310
2311
+ "@openai/agents/openai": ["openai@6.22.0", "", { "peerDependencies": { "ws": "^8.18.0", "zod": "^3.25 || ^4.0" }, "optionalPeers": ["ws", "zod"], "bin": { "openai": "bin/cli" } }, "sha512-7Yvy17F33Bi9RutWbsaYt5hJEEJ/krRPOrwan+f9aCPuMat1WVsb2VNSII5W1EksKT6fF69TG/xj4XzodK3JZw=="],
2312
+
2313
+ "@openai/agents-core/@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.26.0", "", { "dependencies": { "@hono/node-server": "^1.19.9", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-Y5RmPncpiDtTXDbLKswIJzTqu2hyBKxTNsgKqKclDbhIgg1wgtf1fRuvxgTnRfcnxtvvgbIEcqUOzZrJ6iSReg=="],
2314
+
2315
+ "@openai/agents-core/openai": ["openai@6.22.0", "", { "peerDependencies": { "ws": "^8.18.0", "zod": "^3.25 || ^4.0" }, "optionalPeers": ["ws", "zod"], "bin": { "openai": "bin/cli" } }, "sha512-7Yvy17F33Bi9RutWbsaYt5hJEEJ/krRPOrwan+f9aCPuMat1WVsb2VNSII5W1EksKT6fF69TG/xj4XzodK3JZw=="],
2316
+
2317
+ "@openai/agents-openai/openai": ["openai@6.22.0", "", { "peerDependencies": { "ws": "^8.18.0", "zod": "^3.25 || ^4.0" }, "optionalPeers": ["ws", "zod"], "bin": { "openai": "bin/cli" } }, "sha512-7Yvy17F33Bi9RutWbsaYt5hJEEJ/krRPOrwan+f9aCPuMat1WVsb2VNSII5W1EksKT6fF69TG/xj4XzodK3JZw=="],
2318
+
2319
"@opentelemetry/otlp-transformer/@opentelemetry/resources": ["@opentelemetry/resources@2.2.0", "", { "dependencies": { "@opentelemetry/core": "2.2.0", "@opentelemetry/semantic-conventions": "^1.29.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.3.0 <1.10.0" } }, "sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A=="],
2320
2321
"@opentelemetry/resources/@opentelemetry/core": ["@opentelemetry/core@2.3.0", "", { "dependencies": { "@opentelemetry/semantic-conventions": "^1.29.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.10.0" } }, "sha512-PcmxJQzs31cfD0R2dE91YGFcLxOSN4Bxz7gez5UwSUjCai8BwH/GI5HchfVshHkWdTkUs0qcaPJgVHKXUp7I3A=="],
@@ -2498,6 +2508,8 @@
2508
2509
"@langchain/langgraph-sdk/p-queue/p-timeout": ["p-timeout@7.0.1", "", {}, "sha512-AxTM2wDGORHGEkPCt8yqxOTMgpfbEHqF51f/5fJCmwFC3C/zNcGT63SymH2ttOAaiIws2zVg4+izQCjrakcwHg=="],
2510
2511
+ "@openai/agents-core/@modelcontextprotocol/sdk/express-rate-limit": ["express-rate-limit@8.2.1", "", { "dependencies": { "ip-address": "10.0.1" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-PCZEIEIxqwhzw4KF0n7QF4QqruVTcF73O5kFKUnGOyjbCCgizBBiFaYpd/fnBLUMPw/BWw9OsiN7GgrNYr7j6g=="],
2512
+
2513
"@shikijs/vitepress-twoslash/shiki/@shikijs/engine-javascript": ["@shikijs/engine-javascript@3.21.0", "", { "dependencies": { "@shikijs/types": "3.21.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.4" } }, "sha512-ATwv86xlbmfD9n9gKRiwuPpWgPENAWCLwYCGz9ugTJlsO2kOzhOkvoyV/UD+tJ0uT7YRyD530x6ugNSffmvIiQ=="],
2514
2515
"@shikijs/vitepress-twoslash/shiki/@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@3.21.0", "", { "dependencies": { "@shikijs/types": "3.21.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-OYknTCct6qiwpQDqDdf3iedRdzj6hFlOPv5hMvI+hkWfCKs5mlJ4TXziBG9nyabLwGulrUjHiCq3xCspSzErYQ=="],
docs/content/docs/quickstart.mdx
+12
-27
@@ -113,11 +113,10 @@ const tools = await session.tools();
113
const agent = new Agent({
114
name: "Personal Assistant",
115
instructions: "You are a helpful personal assistant. Use Composio tools to take action.",
116
- model: "gpt-5",
116
+ model: "gpt-5.2",
117
tools,
118
});
119
120
-// Memory for multi-turn conversation
120
const memory = new MemorySession();
121
const readline = createInterface({ input: process.stdin, output: process.stdout });
122
@@ -127,23 +126,16 @@ I can use tools like Gmail, GitHub, Linear, Notion, and more.
126
(Type 'exit' to exit)
127
Example tasks:
128
- 'Summarize my emails from today'
130
- - 'List all open issues on the composio github repository and create a Google Sheet with the issues'
129
+ - 'List all open issues on the composio github repository'
130
`);
131
133
-// Multi-turn conversation with agentic tool calling
132
while (true) {
135
- const query = await readline.question("You: ");
136
- const input = query.trim();
137
-
138
- if (input.toLowerCase() === "exit") break;
139
- process.stdout.write("Assistant: ");
133
+ const input = (await readline.question("You: ")).trim();
134
+ if (input.toLowerCase() === "exit") break;
135
141
- try {
142
- const result = await run(agent, input, { session: memory });
143
- process.stdout.write(`${result.finalOutput}\n`);
144
- } catch (error) {
145
- console.error("\n[Error]:", error instanceof Error ? error.message : error);
146
- }
136
+ process.stdout.write("Assistant: ");
137
+ const result = await run(agent, input, { session: memory });
138
+ process.stdout.write(`${result.finalOutput}\n`);
139
}
140
readline.close();
141
```
@@ -260,7 +252,7 @@ const session = await composio.create(userId);
252
const agent = new Agent({
253
name: "Personal Assistant",
254
instructions: "You are a helpful personal assistant. Use Composio tools to take action.",
263
- model: "gpt-5",
255
+ model: "gpt-5.2",
256
tools: [
257
hostedMcpTool({
258
serverLabel: "composio",
@@ -270,7 +262,6 @@ const agent = new Agent({
262
],
263
});
264
273
-// Memory for multi-turn conversation
265
const memory = new MemorySession();
266
const readline = createInterface({ input: process.stdin, output: process.stdout });
267
@@ -280,22 +271,16 @@ I can use tools like Gmail, GitHub, Linear, Notion, and more.
271
(Type 'exit' to exit)
272
Example tasks:
273
- 'Summarize my emails from today'
283
- - 'List all open issues on the composio github repository and create a Google Sheet with the issues'
274
+ - 'List all open issues on the composio github repository'
275
`);
276
286
-// Multi-turn conversation with agentic tool calling
277
while (true) {
278
const input = (await readline.question("You: ")).trim();
279
if (input.toLowerCase() === "exit") break;
280
291
- console.log("Assistant: ");
292
-
293
- try {
294
- const result = await run(agent, input, { session: memory });
295
- console.log(`${result.finalOutput}`);
296
- } catch (error) {
297
- console.error("\n[Error]:", error instanceof Error ? error.message : error);
298
- }
281
+ process.stdout.write("Assistant: ");
282
+ const result = await run(agent, input, { session: memory });
283
+ process.stdout.write(`${result.finalOutput}\n`);
284
}
285
readline.close();
286
```
docs/package.json
+2
-2
@@ -46,7 +46,7 @@
46
"@composio/llamaindex": "^0.5.5",
47
"@composio/mastra": "^0.5.5",
48
"@composio/openai": "^0.5.5",
49
- "@composio/openai-agents": "^0.5.5",
49
+ "@composio/openai-agents": "^0.6.3",
50
"@composio/vercel": "^0.6.3",
51
"@google/genai": "^1.35.0",
52
"@langchain/core": "^1.1.12",
@@ -55,7 +55,7 @@
55
"@llamaindex/openai": "^0.4.22",
56
"@llamaindex/workflow": "^1.1.24",
57
"@mastra/core": "1.0.0-beta.21",
58
- "@openai/agents": "^0.3.7",
58
+ "@openai/agents": "^0.4.13",
59
"@shikijs/vitepress-twoslash": "^3.21.0",
60
"@tailwindcss/postcss": "^4.1.18",
61
"@types/mdx": "^2.0.13",