-
-
Notifications
You must be signed in to change notification settings - Fork 68.7k
bug: Type mismatch between AnyAgentTool and ToolDefinition for customTools parameter #230
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
Description
After commit 110e225 ("fix: pass custom tools via customTools parameter to pi-coding-agent SDK"), the build fails with a TypeScript error:
src/agents/pi-embedded-runner.ts(428,11): error TS2322: Type 'AnyAgentTool[]' is not assignable to type 'ToolDefinition<TSchema, unknown>[]'.
Type 'AnyAgentTool' is not assignable to type 'ToolDefinition<TSchema, unknown>'.
Types of property 'execute' are incompatible.
Root Cause
The SDK's ToolDefinition.execute signature is:
execute(toolCallId, params, onUpdate, ctx, signal): Promise<AgentToolResult>But clawdbot's AnyAgentTool.execute signature is:
execute(toolCallId, params, signal, onUpdate): Promise<AgentToolResult>The parameter order differs (onUpdate and signal are swapped), and the SDK expects an ExtensionContext parameter that clawdbot tools don't have.
Suggested Fix
Cast customTools to any as a workaround until the tool types can be properly aligned:
customTools: customTools as any,Environment
- clawdbot version: v2026.1.5-3
- pi-coding-agent SDK: 0.36.0
- Platform: Linux x64
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Type
Fields
Give feedbackNo fields configured for issues without a type.