rajnandan1
09/10/2025, 5:01 AM#/definitions/SLACK_SEND_MESSAGE/properties/as_user uses .optional() without .nullable() which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required
import { Agent, tool, run } from "@openai/agents";
import dotenv from "dotenv";
import { Composio } from "@composio/client";
import { Composio as ComposioCore } from "@composio/core";
import { OpenAIAgentsProvider } from "@composio/openai-agents";
dotenv.config();
async function main() {
console.log("Starting....");
const composio = new Composio({
apiKey: process.env.COMPOSIO_API_KEY!,
});
const composioCore = new ComposioCore({
apiKey: process.env.COMPOSIO_API_KEY!,
provider: new OpenAIAgentsProvider({
strict: false,
}),
});
const authConfigs = await composio.authConfigs.list({
search: "slack_composio_managed_auth",
});
let exists = authConfigs.items.some(
(cfg) => cfg.name === "slack_composio_managed_auth"
);
if (!exists) {
throw new Error("Auth config does not exist");
}
let authConfig = authConfigs.items.find(
(cfg) => cfg.name === "slack_composio_managed_auth"
);
if (!authConfig) {
throw new Error("Auth config not found");
}
const tools = await composioCore.tools.get(
"raj1234",
{
tools: [
"SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL",
"SLACK_SEND_MESSAGE",
],
},
{
modifySchema: ({ toolSlug, toolkitSlug, schema }) =>
let newSchema = { ...schema, strict: false };
return newSchema;
},
}
); //
console.log("Tools: ", tools);
}
main().catch((error) => {
console.error("Error:", error);
process.exit(1);
});rajnandan1
09/10/2025, 5:04 AM"@composio/anthropic": "^0.1.50",
"@composio/core": "^0.1.50",
"@composio/openai-agents": "^0.1.50",
"@openai/agents": "^0.1.1",
"dotenv": "^17.2.2",
"express": "^4.19.2",
"zod": "^3.25.76"Composio Support Agent
09/10/2025, 5:34 AMCOMPOSIO_LOG_LEVEL=debug in your env or export it in terminal to get complete logs.rajnandan1
09/10/2025, 8:35 AMnpm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @composio/openai-agents@0.1.50
npm error Found: @openai/agents@0.1.1
npm error node_modules/@openai/agents
npm error @openai/agents@"^0.1.1" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @openai/agents@"^0.0.17" from @composio/openai-agents@0.1.50
npm error node_modules/@composio/openai-agents
npm error @composio/openai-agents@"^0.1.50" from the root project
npm error
npm error Conflicting peer dependency: @openai/agents@0.0.17
npm error node_modules/@openai/agents
npm error peer @openai/agents@"^0.0.17" from @composio/openai-agents@0.1.50
npm error node_modules/@composio/openai-agents
npm error @composio/openai-agents@"^0.1.50" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/raj/.npm/_logs/2025-09-10T08_24_34_662Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/raj/.npm/_logs/2025-09-10T08_24_34_662Z-debug-0.lograjnandan1
09/10/2025, 8:35 AMrajnandan1
09/10/2025, 8:35 AMError: Error: Zod field at `#/definitions/SLACK_SEND_MESSAGE/properties/as_user` uses `.optional()` without `.nullable()` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required
at Object.entries.reduce.properties (/Users/raj/Code/pipedream/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/object.ts:55:17)
at Array.reduce (<anonymous>)
at parseObjectDef (/Users/raj/Code/pipedream/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/object.ts:33:36)
at selectParser (/Users/raj/Code/pipedream/node_modules/openai/src/_vendor/zod-to-json-schema/parseDef.ts:181:28)
at parseDef (/Users/raj/Code/pipedream/node_modules/openai/src/_vendor/zod-to-json-schema/parseDef.ts:102:22)
at zodToJsonSchema (/Users/raj/Code/pipedream/node_modules/openai/src/_vendor/zod-to-json-schema/zodToJsonSchema.ts:26:13)
at zodToJsonSchema (/Users/raj/Code/pipedream/node_modules/openai/src/helpers/zod.ts:16:26)
at zodResponsesFunction (/Users/raj/Code/pipedream/node_modules/openai/src/helpers/zod.ts:145:19)
at getSchemaAndParserFromInputType (/Users/raj/Code/pipedream/node_modules/@openai/agents-core/src/utils/tools.ts:51:51)
at tool (/Users/raj/Code/pipedream/node_modules/@openai/agents-core/src/tool.ts:589:73) {
errorId: '36eb066d-9dea-4a37-b0cc-1fc86fc2eadc'
}Composio Support Agent
09/10/2025, 8:37 AMUday
09/10/2025, 10:07 AMrajnandan1
09/10/2025, 10:25 AMComposio Support Agent
09/10/2025, 10:59 AMrajnandan1
09/10/2025, 12:56 PMrajnandan1
09/11/2025, 2:54 AMComposio Support Agent
09/11/2025, 5:09 AMUday
09/11/2025, 8:18 AM@composio/openai-agents@0.1.52. This should support zod3.
Also, please make sure the schema is not set to strict. Let me know if you face any issues.rajnandan1
09/11/2025, 8:20 AMrajnandan1
09/11/2025, 8:36 AMUsing the first connected account for tool SLACK_SEND_MESSAGE. To change this behaviour please explicitly pass a connectedAccountId for the tool
the whole code I have attached
https://cdn.discordapp.com/attachments/1415200359869059164/1415617033281863680/agents.ts?ex=68c3db99&is=68c28a19&hm=23ce93a2160678f294544faf16de9ec1c48dbb2b29cda1bb0c5dfb49b8c7596f&Composio Support Agent
09/11/2025, 8:46 AMuser_id of the connected account you want to use.
https://cdn.discordapp.com/attachments/1415200359869059164/1415619416388927598/Screenshot_2025-09-11_at_14.15.07.png?ex=68c3ddd1&is=68c28c51&hm=45c008bfa3061a324df6c106da317b17af2c1a9ce07945624a288948e8ecd80e&Composio Support Agent
09/11/2025, 8:56 AMuser_id . Let me quickly check this and revert back.abhishekpatil4
09/11/2025, 9:23 AMuser_id and if you specify the user_id while getting the tools // executing then the most recent connection would be used. You can override this by specifying the connected account ID in [before_execute](https://docs.composio.dev/docs/modifiers/before-execution)
beforeExecute: ({ toolSlug, toolkitSlug, params }) => {
if (toolSlug === "GMAIL_FETCH_EMAILS") {
params.connectedAccountId = "ca_..."
}
return params;
},rajnandan1
09/11/2025, 2:17 PMabhishekpatil4
09/11/2025, 3:55 PMLshoo
09/25/2025, 9:59 PM