Skip to content

Commit bbe8dcb

Browse files
committed
test(plugin-sdk): keep live catalog coverage focused
1 parent d046a8d commit bbe8dcb

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

‎src/plugin-sdk/provider-catalog-live-normalize.tokens.test.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@ function firstModel(row: Record<string, unknown>) {
1616
}
1717

1818
describe("live discovery vendor token-limit fields", () => {
19+
it("fills an omitted seed window from the matching live row", () => {
20+
const [model] = buildOpenAICompatibleLiveModels(
21+
[{ id: "transport-only", object: "model", context_window: 262_144 }],
22+
{
23+
...fallback,
24+
models: [
25+
{
26+
id: "transport-only",
27+
name: "Transport only",
28+
reasoning: false,
29+
input: ["text"],
30+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
31+
maxTokens: 8192,
32+
},
33+
],
34+
},
35+
);
36+
37+
expect(model?.contextWindow).toBe(262_144);
38+
});
39+
1940
it("reads Anthropic's max_input_tokens and max_tokens", () => {
2041
// Anthropic names the context window by its input side and the output cap
2142
// as max_tokens; before this mapping both fell back to generic defaults.

‎src/plugin-sdk/provider-catalog-live-runtime.test.ts‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -876,27 +876,6 @@ describe("provider-catalog-live-runtime", () => {
876876
expect((headers as Headers).get("authorization")).toBe("Bearer provider-key");
877877
});
878878

879-
it("fills an omitted seed window from the matching live row", async () => {
880-
const { contextWindow: _contextWindow, ...transportOnly } = buildModel("chat-v1");
881-
const { fetchGuard } = buildFetchGuard({
882-
data: [{ id: "chat-v1", object: "model", context_window: 262_144 }],
883-
});
884-
885-
const provider = await buildOpenAICompatibleLiveModelProviderConfig({
886-
providerId: "provider",
887-
providerConfig: {
888-
api: "openai-completions",
889-
baseUrl: "https://provider.example.test/v1",
890-
models: [transportOnly],
891-
},
892-
fetchGuard,
893-
});
894-
895-
expect(provider.models).toEqual([
896-
expect.objectContaining({ id: "chat-v1", contextWindow: 262_144 }),
897-
]);
898-
});
899-
900879
it("keeps authored static metadata for live ids already in the provider seed", async () => {
901880
const { fetchGuard } = buildFetchGuard({
902881
data: [{ id: "chat-v1", object: "model", context_window: 1 }],

0 commit comments

Comments
 (0)