mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-21 22:52:19 +03:00
fix(tests): update test snapshots and registry for PRs merged into v3.8.0
- providerModels: supportsXHighEffort returns true for unknown providers (passthrough) so PR #2162 sanitizeReasoningEffortForProvider no longer downgrades xhigh for non-registry custom providers - providerRegistry(openai): add gpt-4o + gpt-4o-2024-11-20 with explicit contextLength so catalog tests can resolve them without synced DB data - context-manager.test: update GPT-5.5 Codex expected context 1050000→400000 (PR #2163 capped codex OAuth context at 400K) - provider-models-config.test: update kiro claude-opus-4.7 contextLength undefined→1000000 (PR #2163 added explicit context window) - oauth-providers-config.test: add windsurf and devin-cli to expected provider keys and config map (PR #2168) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -61,5 +61,8 @@ export function getModelsByProviderId(providerId: string): RegistryModel[] {
|
||||
|
||||
export function supportsXHighEffort(aliasOrId: string, modelId: string): boolean {
|
||||
const alias = PROVIDER_ID_TO_ALIAS[aliasOrId] || aliasOrId;
|
||||
const providerModels = PROVIDER_MODELS[alias] || PROVIDER_MODELS[aliasOrId];
|
||||
// Unknown provider (not in registry) — pass through unchanged.
|
||||
if (!providerModels) return true;
|
||||
return getProviderModel(alias, modelId)?.supportsXHighEffort === true;
|
||||
}
|
||||
|
||||
@@ -875,7 +875,8 @@ export const REGISTRY: Record<string, RegistryEntry> = {
|
||||
{ id: "gpt-5.4-mini", name: "GPT-5.4 Mini" },
|
||||
{ id: "gpt-5.4-nano", name: "GPT-5.4 Nano" },
|
||||
{ id: "gpt-4.1", name: "GPT-4.1" },
|
||||
{ id: "gpt-4o-2024-11-20", name: "GPT-4o" },
|
||||
{ id: "gpt-4o", name: "GPT-4o", contextLength: 128000 },
|
||||
{ id: "gpt-4o-2024-11-20", name: "GPT-4o (Nov 2024)", contextLength: 128000 },
|
||||
{ id: "o3", name: "O3", unsupportedParams: REASONING_UNSUPPORTED },
|
||||
],
|
||||
},
|
||||
|
||||
@@ -27,7 +27,7 @@ test("getTokenLimit: detects gemini", () => {
|
||||
});
|
||||
|
||||
test("getTokenLimit: uses GPT-5.5 Codex model context", () => {
|
||||
assert.equal(getTokenLimit("codex", "gpt-5.5"), 1050000);
|
||||
assert.equal(getTokenLimit("codex", "gpt-5.5"), 400000);
|
||||
});
|
||||
|
||||
test("getTokenLimit: default fallback", () => {
|
||||
|
||||
@@ -42,6 +42,7 @@ const {
|
||||
PROVIDERS: OAUTH_PROVIDER_IDS,
|
||||
QODER_CONFIG,
|
||||
QWEN_CONFIG,
|
||||
WINDSURF_CONFIG,
|
||||
} = oauthModule;
|
||||
const { REGISTRY } = registryModule;
|
||||
|
||||
@@ -62,6 +63,8 @@ const EXPECTED_PROVIDER_KEYS = [
|
||||
"cursor",
|
||||
"kilocode",
|
||||
"cline",
|
||||
"windsurf",
|
||||
"devin-cli",
|
||||
];
|
||||
|
||||
const EXPECTED_CONFIG_BY_PROVIDER = {
|
||||
@@ -79,6 +82,8 @@ const EXPECTED_CONFIG_BY_PROVIDER = {
|
||||
cursor: CURSOR_CONFIG,
|
||||
kilocode: KILOCODE_CONFIG,
|
||||
cline: CLINE_CONFIG,
|
||||
windsurf: WINDSURF_CONFIG,
|
||||
"devin-cli": WINDSURF_CONFIG,
|
||||
};
|
||||
|
||||
const REQUIRED_FIELDS_BY_PROVIDER = {
|
||||
@@ -123,6 +128,8 @@ const REQUIRED_FIELDS_BY_PROVIDER = {
|
||||
cursor: ["apiEndpoint", "api3Endpoint", "agentEndpoint", "agentNonPrivacyEndpoint", "dbKeys"],
|
||||
kilocode: ["apiBaseUrl", "initiateUrl", "pollUrlBase"],
|
||||
cline: ["appBaseUrl", "apiBaseUrl", "authorizeUrl", "tokenExchangeUrl", "refreshUrl"],
|
||||
windsurf: ["authorizeUrl", "apiServerUrl", "exchangePath", "inferenceUrl"],
|
||||
"devin-cli": ["authorizeUrl", "apiServerUrl", "exchangePath", "inferenceUrl"],
|
||||
};
|
||||
|
||||
function getByPath(object, path) {
|
||||
|
||||
@@ -81,7 +81,7 @@ test("Kiro registry exposes the current CLI model lineup with context windows",
|
||||
const byId = new Map(kiroModels.map((model) => [model.id, model]));
|
||||
|
||||
assert.ok(byId.has("claude-opus-4.7"));
|
||||
assert.equal(byId.get("claude-opus-4.7")?.contextLength, undefined); // Uses default
|
||||
assert.equal(byId.get("claude-opus-4.7")?.contextLength, 1000000);
|
||||
assert.ok(byId.has("claude-sonnet-4.6"));
|
||||
assert.ok(byId.has("claude-haiku-4.5"));
|
||||
assert.equal(byId.has("claude-opus-4-7"), false);
|
||||
|
||||
Reference in New Issue
Block a user