From 0d6643e24413d081b10ed5c0f3c20aecf1deabb4 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 13 Apr 2026 14:08:28 -0700 Subject: [PATCH] test: align cron runtime seams --- src/cron/isolated-agent.model-formatting.test.ts | 14 ++++---------- src/cron/isolated-agent.session-identity.test.ts | 4 ++-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/cron/isolated-agent.model-formatting.test.ts b/src/cron/isolated-agent.model-formatting.test.ts index 3d58187906e..a89cbefc421 100644 --- a/src/cron/isolated-agent.model-formatting.test.ts +++ b/src/cron/isolated-agent.model-formatting.test.ts @@ -4,7 +4,6 @@ import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js"; const { loadModelCatalogMock, getModelRefStatusMock, - normalizeProviderIdMock, normalizeModelSelectionMock, resolveAllowedModelRefMock, resolveConfiguredModelRefMock, @@ -12,9 +11,6 @@ const { } = vi.hoisted(() => ({ loadModelCatalogMock: vi.fn(), getModelRefStatusMock: vi.fn(), - normalizeProviderIdMock: vi.fn((value: unknown) => - typeof value === "string" && value.trim() ? value.trim().toLowerCase() : "", - ), normalizeModelSelectionMock: vi.fn((value: unknown) => { if (typeof value === "string" && value.trim()) { return value.trim(); @@ -34,13 +30,11 @@ const { resolveHooksGmailModelMock: vi.fn(), })); -vi.mock("../agents/model-catalog.js", () => ({ - loadModelCatalog: loadModelCatalogMock, -})); - -vi.mock("../agents/model-selection.js", () => ({ +vi.mock("./isolated-agent/run-model-selection.runtime.js", () => ({ + DEFAULT_MODEL: "claude-opus-4-6", + DEFAULT_PROVIDER: "anthropic", getModelRefStatus: getModelRefStatusMock, - normalizeProviderId: normalizeProviderIdMock, + loadModelCatalog: loadModelCatalogMock, normalizeModelSelection: normalizeModelSelectionMock, resolveAllowedModelRef: resolveAllowedModelRefMock, resolveConfiguredModelRef: resolveConfiguredModelRefMock, diff --git a/src/cron/isolated-agent.session-identity.test.ts b/src/cron/isolated-agent.session-identity.test.ts index 8327dc72316..3bdf4851017 100644 --- a/src/cron/isolated-agent.session-identity.test.ts +++ b/src/cron/isolated-agent.session-identity.test.ts @@ -2,7 +2,7 @@ import "./isolated-agent.mocks.js"; import fs from "node:fs/promises"; import path from "node:path"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import * as modelSelection from "../agents/model-selection.js"; +import * as modelThinkingDefault from "../agents/model-thinking-default.js"; import { runCronIsolatedAgentTurn } from "./isolated-agent.js"; import { makeCfg, makeJob, writeSessionStore } from "./isolated-agent.test-harness.js"; import { @@ -24,7 +24,7 @@ setupRunCronIsolatedAgentTurnSuite(); describe("runCronIsolatedAgentTurn session identity", () => { beforeEach(() => { - vi.spyOn(modelSelection, "resolveThinkingDefault").mockReturnValue("off"); + vi.spyOn(modelThinkingDefault, "resolveThinkingDefault").mockReturnValue("off"); runEmbeddedPiAgentMock.mockClear(); mockRunCronFallbackPassthrough(); });