Files
9router/tests/unit/capabilities-opus-context.test.js
luulam 7e45ead2ac Merge remote-tracking branch 'origin/master' into gitea/feature/end
Resolved conflicts taking origin/master (v0.5.55) as canonical, with local
features re-applied:
- runtime log level (LOG_LEVEL env + dashboard Settings → Logging, applied
  immediately and persisted across restarts)
- free/noAuth provider enable/disable toggle via providerStrategies.enabled
- parallel model testing (Test All Models / Test Selected Keys)
2026-08-17 00:38:31 +07:00

39 lines
1.2 KiB
JavaScript

import { describe, expect, it } from "vitest";
import { getCapabilitiesForModel } from "../../open-sse/providers/capabilities.js";
// Claude Opus 4.6+ ships a 1M-token context window (GA, standard pricing).
// The registry exposes dashed ids (claude-opus-5, claude-opus-4-8, claude-opus-4-7), which
// must resolve to the 1M context + adaptive thinking caps rather than falling
// through to the generic *claude*opus* pattern (200k / budget thinking).
describe("Claude Opus 1M context capabilities", () => {
const expected = {
contextWindow: 1000000,
maxOutput: 128000,
thinkingFormat: "claude-adaptive",
reasoning: true,
vision: true,
search: true,
};
for (const model of [
"claude-opus-5",
"claude-opus-5-thinking",
"claude-opus-5-agentic",
"claude-opus-5-thinking-agentic",
"claude-opus-4-8",
"claude-opus-4.8",
"claude-opus-4-7",
"claude-opus-4.7",
"claude-opus-4-6",
]) {
it(`resolves ${model} to a 1M context window`, () => {
expect(getCapabilitiesForModel("cc", model)).toMatchObject(expected);
});
}
it("keeps the older Opus 4.5 at the standard 200k context", () => {
expect(getCapabilitiesForModel("cc", "claude-opus-4-5-20251101").contextWindow).toBe(200000);
});
});