@devries-cameron20 / composio Mirror · read-only / commits / 343234b9b
Fork 0

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 22, 18:15 UTC

Fix non-agentic tool execution (#2195)

Karan Vaidya committed Nov 22, 2025 at 23:07 UTC 343234b9b80836f9cfa42c40481d96608845b774
1 file changed +15 -2
ts/packages/core/src/models/Tools.ts
+15 -2
@@ -80,8 +80,21 @@ export class Tools<
80 this.toolkitVersions = config?.toolkitVersions ?? 'latest';
81 // Bind the execute method to ensure correct 'this' context
82 this.execute = this.execute.bind(this);
83 - // Set the execute method for the provider
84 - this.provider._setExecuteToolFn(this.execute);
83 + // Set the execute method for the provider.
84 + // Non-agentic providers (e.g., OpenAI/Anthropic tool calling) should default to skipping the
85 + // "latest" version guard so agent responses never fail due to missing toolkit versions.
86 + const providerExecuteToolFn = this.provider._isAgentic
87 + ? this.execute
88 + : (slug: string, body: ToolExecuteParams, modifiers?: ExecuteToolModifiers) =>
89 + this.execute(
90 + slug,
91 + {
92 + ...body,
93 + dangerouslySkipVersionCheck: body.dangerouslySkipVersionCheck ?? true,
94 + },
95 + modifiers
96 + );
97 + this.provider._setExecuteToolFn(providerExecuteToolFn);
98 // Bind methods that use customTools to ensure correct 'this' context
99 this.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);
100 this.getRawComposioTools = this.getRawComposioTools.bind(this);