mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
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.
43 lines
1.0 KiB
TypeScript
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
|
|
);
|
|
});
|