diff --git a/src/agents/pi-embedded-runner/run.ts b/src/agents/pi-embedded-runner/run.ts index 764622c88ab..6d3c0e8ae55 100644 --- a/src/agents/pi-embedded-runner/run.ts +++ b/src/agents/pi-embedded-runner/run.ts @@ -888,6 +888,7 @@ export async function runEmbeddedPiAgent( prompt, images: params.images, disableTools: params.disableTools, + clientTools: params.clientTools, onPreflightPassed: params.onPreflightPassed, provider, modelId, diff --git a/src/commands/agent.test.ts b/src/commands/agent.test.ts index 23c2647d2bc..4a7714c04e8 100644 --- a/src/commands/agent.test.ts +++ b/src/commands/agent.test.ts @@ -420,11 +420,22 @@ describe("agentCommand", () => { const store = path.join(home, "sessions.json"); mockConfig(home, store); const onPreflightPassed = vi.fn(); + const clientTools = [ + { + type: "function", + function: { + name: "web_search", + description: "test client tool", + parameters: { type: "object", additionalProperties: false, properties: {} }, + }, + }, + ]; await agentCommandFromIngress( - { message: "hi", to: "+1555", senderIsOwner: false, onPreflightPassed }, + { message: "hi", to: "+1555", senderIsOwner: false, clientTools, onPreflightPassed }, runtime, ); const ingressCall = vi.mocked(runEmbeddedPiAgent).mock.calls.at(-1)?.[0]; + expect(ingressCall?.clientTools).toBe(clientTools); expect(ingressCall?.onPreflightPassed).toBe(onPreflightPassed); }); });