mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 20:35:39 -06:00
chore(doctor): format migration tests, keep cron migration helpers module-local
This commit is contained in:
@@ -42,7 +42,7 @@ function hasShellToolAccess(toolsAllow: unknown): boolean {
|
||||
});
|
||||
}
|
||||
|
||||
export type LegacyOpenAICodexCronModelRoute = {
|
||||
type LegacyOpenAICodexCronModelRoute = {
|
||||
legacyModelRef: string;
|
||||
canonicalModelRef: string;
|
||||
};
|
||||
@@ -76,7 +76,7 @@ export function collectLegacyOpenAICodexCronModelRoutes(
|
||||
}
|
||||
|
||||
/** Canonical OpenAI refs whose legacy cron shape implied the Codex runtime. */
|
||||
export function collectLegacyOpenAICodexCronModelRefs(payload: UnknownRecord): string[] {
|
||||
function collectLegacyOpenAICodexCronModelRefs(payload: UnknownRecord): string[] {
|
||||
return [
|
||||
...new Set(
|
||||
collectLegacyOpenAICodexCronModelRoutes(payload).map((route) => route.canonicalModelRef),
|
||||
|
||||
@@ -34,9 +34,9 @@ vi.mock("../../../plugins/installed-plugin-index.js", async (importOriginal) =>
|
||||
}));
|
||||
|
||||
import { legacyCodexProviderIdentityKey } from "./codex-route-model-ref.js";
|
||||
import { collectBlockedLegacyOpenAICodexProviderPlan } from "./legacy-config-migrations.runtime.models.js";
|
||||
import { repairCodexSessionStoreRoutes } from "./codex-route-session-repair.test-support.js";
|
||||
import { collectCodexRouteWarnings, maybeRepairCodexRoutes } from "./codex-route-warnings.js";
|
||||
import { collectBlockedLegacyOpenAICodexProviderPlan } from "./legacy-config-migrations.runtime.models.js";
|
||||
|
||||
describe("collectCodexRouteWarnings", () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -324,8 +324,9 @@ vi.mock("./codex-route-warnings.js", () => ({
|
||||
|
||||
async function useRealCodexRouteWarningsOnce(): Promise<void> {
|
||||
const mocked = await import("./codex-route-warnings.js");
|
||||
const actual =
|
||||
await vi.importActual<typeof import("./codex-route-warnings.js")>("./codex-route-warnings.js");
|
||||
const actual = await vi.importActual<typeof import("./codex-route-warnings.js")>(
|
||||
"./codex-route-warnings.js",
|
||||
);
|
||||
vi.mocked(mocked.collectCodexRouteWarnings).mockImplementationOnce(
|
||||
actual.collectCodexRouteWarnings,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user