Skip to content

bug: Type mismatch between AnyAgentTool and ToolDefinition for customTools parameter #230

@cash-echo-bot

Description

@cash-echo-bot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions