test(engine): add describeModel to heartbeat pi.js mocks (heartbeat-executor + heartbeat-skills)
This commit is contained in:
@@ -25,6 +25,12 @@ vi.mock("../logger.js", async () => {
|
||||
});
|
||||
vi.mock("../pi.js", () => ({
|
||||
createFnAgent: vi.fn(),
|
||||
// FNXC:EngineTestDrift 2026-07-11-22:23:
|
||||
// DefaultPiRuntime.describeModel (runtime-resolution.ts) now reaches the real
|
||||
// pi.js describeModel export on the heartbeat path. The hand-written pi.js
|
||||
// mock must surface it or vitest throws "No describeModel export is defined",
|
||||
// which cascades into createFnAgent failing and every heartbeat ending 'failed'.
|
||||
describeModel: vi.fn().mockReturnValue("mock-provider/mock-model"),
|
||||
promptWithFallback: vi.fn(async (session: any, prompt: string) => {
|
||||
await session.prompt(prompt);
|
||||
}),
|
||||
|
||||
@@ -14,6 +14,11 @@ vi.mock("../logger.js", async () => {
|
||||
});
|
||||
vi.mock("../pi.js", () => ({
|
||||
createFnAgent: vi.fn(),
|
||||
// FNXC:EngineTestDrift 2026-07-11-22:23:
|
||||
// DefaultPiRuntime.describeModel now reaches pi.js describeModel on the
|
||||
// heartbeat path; the mock must surface it or createFnAgent throws and the
|
||||
// whole heartbeat cascades to 'failed'.
|
||||
describeModel: vi.fn().mockReturnValue("mock-provider/mock-model"),
|
||||
promptWithFallback: vi.fn(async (session: any, prompt: string) => {
|
||||
await session.prompt(prompt);
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user