@devries-cameron20 / composio Mirror · read-only / commits / 51ca3ee8c
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, 02:00 UTC

fix: lint error and partial response fallback in buildCustomToolsMapFromResponse

- Fix @typescript-eslint/no-explicit-any on _def.typeName check - Fix fallback condition: only fall back to client-side prefix computation when experimental is entirely missing, not when one group is present Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Dhawal Upadhyay committed Mar 18, 2026 at 13:21 UTC 51ca3ee8cd25cc3c9a695b1eb259eae1e28d1a62
1 file changed +4 -3
ts/packages/core/src/models/CustomTool.ts
+4 -3
@@ -130,7 +130,8 @@ export function createCustomTool<T extends z.ZodType>(
130 }
131 // Check for z.object() — use _def.typeName instead of instanceof to work
132 // across different Zod instances (e.g. when user imports their own zod/v3)
133 - if ((options.inputParams as any)?._def?.typeName !== 'ZodObject') {
133 + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Zod internals, cross-instance safe
134 + if ((options.inputParams as { _def?: { typeName?: string } })?._def?.typeName !== 'ZodObject') {
135 throw new ValidationError(
136 'createCustomTool: inputParams must be a z.object() schema. ' +
137 'Tool input parameters are always an object with named properties.'
@@ -419,8 +420,8 @@ export function buildCustomToolsMapFromResponse(
420 }
421 }
422
422 - // Fallback: if no response mapping available, use client-side prefix computation
423 - if (!experimental?.custom_tools && !experimental?.custom_toolkits) {
423 + // Fallback: if backend returned no mapping at all, use client-side prefix computation
424 + if (!experimental) {
425 return buildCustomToolsMap(tools, toolkits);
426 }
427