Files
OmniRoute/tests/unit/cli/setup-codex.test.ts
skyzea1 d47ea7b147 feat(codex): generate fallback profiles for compatible models (#5701)
setup-codex now generates Codex profiles for compatible text models from the live /v1/models catalog when the model id doesn't match a hand-tuned pattern, skipping media/embedding models. Integrated into release/v3.8.43.
2026-06-30 17:18:41 -03:00

43 lines
1.0 KiB
TypeScript

import { test } from "node:test";
import assert from "node:assert/strict";
import {
fallbackCodexProfile,
isCodexCompatibleTextModel,
} from "../../../bin/cli/commands/setup-codex.mjs";
test("fallbackCodexProfile creates profiles for compatible live catalog models", () => {
const cfg = fallbackCodexProfile("new-provider/future-chat-1", {
id: "new-provider/future-chat-1",
context_length: 250000,
max_output_tokens: 65536,
output_modalities: ["text"],
});
assert.deepEqual(cfg, {
name: "new-provider-future-chat-1",
ctx: 250000,
compact: 212500,
summary: false,
toolLimit: 32768,
});
});
test("fallbackCodexProfile skips media and non-text models", () => {
assert.equal(
isCodexCompatibleTextModel({
id: "antigravity/gemini-3.1-flash-image",
type: "image",
output_modalities: ["image"],
}),
false
);
assert.equal(
fallbackCodexProfile("veo-free/seedance", {
id: "veo-free/seedance",
name: "Seedance",
context_length: 128000,
}),
null
);
});