test(engine): add wrapToolsWithRtkRewrite/PermanentAgentGating/ActionGate to pi.js mocks (openclaw + reviewer)
This commit is contained in:
@@ -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", () => ({
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user