diff --git a/packages/engine/src/__tests__/openclaw-runtime-e2e.test.ts b/packages/engine/src/__tests__/openclaw-runtime-e2e.test.ts index 960b4e2fe9..f06b47017a 100644 --- a/packages/engine/src/__tests__/openclaw-runtime-e2e.test.ts +++ b/packages/engine/src/__tests__/openclaw-runtime-e2e.test.ts @@ -39,6 +39,10 @@ vi.mock("../pi.js", () => ({ createFnAgent: mockCreateFnAgent, promptWithFallback: mockPromptWithFallback, describeModel: mockDescribeModel, + // FNXC: pi.js tool-policy wrappers (wrapToolsWithRtkRewrite, wrapToolsWithPermanentAgentGating, wrapToolsWithActionGate) are now imported by agent-session-helpers.ts (wrapCustomToolsForPluginRuntime, called from createResolvedAgentSession). Mocks pass tools through unchanged. + wrapToolsWithRtkRewrite: vi.fn((tools) => tools), + wrapToolsWithPermanentAgentGating: vi.fn((tools) => tools), + wrapToolsWithActionGate: vi.fn((tools) => tools), })); vi.mock("node:child_process", () => ({ diff --git a/packages/engine/src/__tests__/openclaw-runtime-integration.test.ts b/packages/engine/src/__tests__/openclaw-runtime-integration.test.ts index 72268884f9..fa9b8923d7 100644 --- a/packages/engine/src/__tests__/openclaw-runtime-integration.test.ts +++ b/packages/engine/src/__tests__/openclaw-runtime-integration.test.ts @@ -19,6 +19,10 @@ vi.mock("../pi.js", () => ({ createFnAgent: mockCreateFnAgent, promptWithFallback: vi.fn().mockResolvedValue(undefined), describeModel: vi.fn().mockReturnValue("pi/default"), + // FNXC: pi.js tool-policy wrappers (wrapToolsWithRtkRewrite, wrapToolsWithPermanentAgentGating, wrapToolsWithActionGate) are now imported by agent-session-helpers.ts (wrapCustomToolsForPluginRuntime, called from createResolvedAgentSession). Mocks pass tools through unchanged. + wrapToolsWithRtkRewrite: vi.fn((tools) => tools), + wrapToolsWithPermanentAgentGating: vi.fn((tools) => tools), + wrapToolsWithActionGate: vi.fn((tools) => tools), })); function isAgentRuntime(value: unknown): value is AgentRuntime { diff --git a/packages/engine/src/__tests__/reviewer.test.ts b/packages/engine/src/__tests__/reviewer.test.ts index 7604589463..67e7067f6a 100644 --- a/packages/engine/src/__tests__/reviewer.test.ts +++ b/packages/engine/src/__tests__/reviewer.test.ts @@ -18,6 +18,10 @@ vi.mock("../pi.js", () => ({ await session.promptWithFallback(prompt, options); } }), + // FNXC: pi.js tool-policy wrappers (wrapToolsWithRtkRewrite, wrapToolsWithPermanentAgentGating, wrapToolsWithActionGate) are now imported by agent-session-helpers.ts (wrapCustomToolsForPluginRuntime, called from createResolvedAgentSession). Mocks pass tools through unchanged. + wrapToolsWithRtkRewrite: vi.fn((tools) => tools), + wrapToolsWithPermanentAgentGating: vi.fn((tools) => tools), + wrapToolsWithActionGate: vi.fn((tools) => tools), })); import { resolveAgentPrompt } from "@fusion/core";