test(engine): add describeModel to heartbeat pi.js mocks (heartbeat-executor + heartbeat-skills)

This commit is contained in:
gsxdsm
2026-07-10 22:25:50 -07:00
parent 1bf52758e4
commit 7d5f8ee9ea
2 changed files with 11 additions and 0 deletions

View File

@@ -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);
}),

View File

@@ -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);
}),