Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
Fix non-agentic tool execution (#2195)
Karan Vaidya343234b9b808
diff --git a/ts/packages/core/src/models/Tools.ts b/ts/packages/core/src/models/Tools.tsindex d73f3a975..dec14a295 100644--- a/ts/packages/core/src/models/Tools.ts+++ b/ts/packages/core/src/models/Tools.ts@@ -80,8 +80,21 @@ export class Tools<this.toolkitVersions = config?.toolkitVersions ?? 'latest';// Bind the execute method to ensure correct 'this' contextthis.execute = this.execute.bind(this);- // Set the execute method for the provider- this.provider._setExecuteToolFn(this.execute);+ // Set the execute method for the provider.+ // Non-agentic providers (e.g., OpenAI/Anthropic tool calling) should default to skipping the+ // "latest" version guard so agent responses never fail due to missing toolkit versions.+ const providerExecuteToolFn = this.provider._isAgentic+ ? this.execute+ : (slug: string, body: ToolExecuteParams, modifiers?: ExecuteToolModifiers) =>+ this.execute(+ slug,+ {+ ...body,+ dangerouslySkipVersionCheck: body.dangerouslySkipVersionCheck ?? true,+ },+ modifiers+ );+ this.provider._setExecuteToolFn(providerExecuteToolFn);// Bind methods that use customTools to ensure correct 'this' contextthis.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);this.getRawComposioTools = this.getRawComposioTools.bind(this);