-
Notifications
You must be signed in to change notification settings - Fork 479
fix(catalog): accept Together top-level /models arrays #639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -135,6 +135,19 @@ describe("POST /api/providers/test (WP040 connectivity probe)", () => { | |
| expect(body.models).toBe(3); | ||
| }); | ||
|
|
||
| test("Together-style top-level /models array is accepted (#617)", async () => { | ||
| globalThis.fetch = (async () => new Response(JSON.stringify([{ id: "meta/llama" }, { id: "Qwen/Qwen" }]), { | ||
| status: 200, | ||
| headers: { "content-type": "application/json" }, | ||
| })) as typeof fetch; | ||
| const config = baseConfig({ | ||
| together: { adapter: "openai-chat", baseUrl: "https://api.together.xyz/v1", apiKey: "tg-key" }, | ||
| }); | ||
| const { body } = await probe(config, "together"); | ||
| expect(body.ok).toBe(true); | ||
| expect(body.models).toBe(2); | ||
| }); | ||
|
Comment on lines
+138
to
+149
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win Add catalog-discovery coverage for the Together response. This test verifies only Add a focused catalog test using the same top-level array and assert that the discovered catalog contains As per path instructions, a behavior change in 🤖 Prompt for AI AgentsSource: Path instructions |
||
|
|
||
| test("malformed 2xx data is an explicit failure, not a silent pass", async () => { | ||
| globalThis.fetch = (async () => new Response(JSON.stringify({ nope: true }), { | ||
| status: 200, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modelsFor an OpenAI-chat provider returning
{ models: [] }, this branch now yields an empty array;isProviderModelsApiItemsaccepts it vacuously, so discovery becomes authoritative-empty and drops the configured fallback. That directly contradicts the unchangedmissing-datacase intests/codex-catalog.test.ts:1888-1917, which expectsstatic-fallbackand aninvalid_responsestatus, so the catalog suite will fail. Either restrict this envelope to provider-aware Google handling or update the catalog contract and add a focused top-level-array catalog regression, rather than testing only the management probe.AGENTS.md reference: AGENTS.md:L93-L95
Useful? React with 👍 / 👎.