From 6663d700045fd5dbedc11d3577d4532428282ad6 Mon Sep 17 00:00:00 2001 From: Paijo <14921983+oyi77@users.noreply.github.com> Date: Fri, 21 Aug 2026 14:24:45 +0700 Subject: [PATCH] provider(agnes): refresh chat catalog to 2026.07.30 (openai chat/completions, 1.5/2.0/2.5-flash) (#10942) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Validado no worktree combinado: typecheck:core, changelog-integrity, complexity, cognitive-complexity, file-size, lint e teste focado (agnes-provider, 11/11) todos verdes. Atualização de catálogo/dados alinhada à documentação oficial vigente. CI vermelho é o base-red já rastreado em #9985. Obrigado! --- open-sse/config/freeModelCatalog.data.ts | 3 +- .../config/providers/registry/agnes/index.ts | 19 ++++--- tests/unit/agnes-provider.test.ts | 51 ++++++++++--------- 3 files changed, 41 insertions(+), 32 deletions(-) diff --git a/open-sse/config/freeModelCatalog.data.ts b/open-sse/config/freeModelCatalog.data.ts index fe30a37325..8236a4d5d8 100644 --- a/open-sse/config/freeModelCatalog.data.ts +++ b/open-sse/config/freeModelCatalog.data.ts @@ -439,7 +439,8 @@ export const FREE_MODEL_BUDGETS: FreeModelBudget[] = [ { provider: "ovhcloud", modelId: "Qwen3.6-27B", displayName: "Qwen3.6 27B (OVH anonymous)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "ovhcloud-anon", tos: "ok" }, { provider: "ovhcloud", modelId: "Mistral-Small-3.2-24B-Instruct-2506", displayName: "Mistral Small 3.2 24B (OVH anonymous)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "ovhcloud-anon", tos: "ok" }, { provider: "ovhcloud", modelId: "Qwen2.5-VL-72B-Instruct", displayName: "Qwen2.5 VL 72B (OVH anonymous)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "ovhcloud-anon", tos: "ok" }, - { provider: "agnes", modelId: "agnes-2.5-pro", displayName: "Agnes 2.5 Pro", monthlyTokens: 0, creditTokens: 0, freeType: "recurring-uncapped", poolKey: "agnes-free", tos: "ok" }, + { provider: "agnes", modelId: "agnes-1.5-flash", displayName: "Agnes 1.5 Flash", monthlyTokens: 0, creditTokens: 0, freeType: "recurring-uncapped", poolKey: "agnes-free", tos: "ok" }, + { provider: "agnes", modelId: "agnes-2.0-flash", displayName: "Agnes 2.0 Flash", monthlyTokens: 0, creditTokens: 0, freeType: "recurring-uncapped", poolKey: "agnes-free", tos: "ok" }, { provider: "agnes", modelId: "agnes-2.5-flash", displayName: "Agnes 2.5 Flash", monthlyTokens: 0, creditTokens: 0, freeType: "recurring-uncapped", poolKey: "agnes-free", tos: "ok" }, { provider: "glm", modelId: "glm-4.7-flash", displayName: "GLM-4.7-Flash", monthlyTokens: 0, creditTokens: 0, freeType: "recurring-uncapped", poolKey: "zhipu-flash-free", tos: "ok" }, { provider: "glm", modelId: "glm-4.5-flash", displayName: "GLM-4.5-Flash", monthlyTokens: 0, creditTokens: 0, freeType: "recurring-uncapped", poolKey: "zhipu-flash-free", tos: "ok" }, diff --git a/open-sse/config/providers/registry/agnes/index.ts b/open-sse/config/providers/registry/agnes/index.ts index 848ad0242c..2843328f00 100644 --- a/open-sse/config/providers/registry/agnes/index.ts +++ b/open-sse/config/providers/registry/agnes/index.ts @@ -2,21 +2,28 @@ import type { RegistryEntry } from "../../shared.ts"; export const agnesProvider: RegistryEntry = { id: "agnes", - format: "openai-responses", + format: "openai", executor: "default", - baseUrl: "https://apihub.agnes-ai.com/v1/responses", + baseUrl: "https://apihub.agnes-ai.com/v1/chat/completions", authType: "apikey", authHeader: "bearer", models: [ { - id: "agnes-2.5-pro", - name: "Agnes 2.5 Pro", - contextLength: 1048576, + id: "agnes-1.5-flash", + name: "Agnes 1.5 Flash", + contextLength: 262144, + maxOutputTokens: 65536, + supportsVision: true, + toolCalling: true, + }, + { + id: "agnes-2.0-flash", + name: "Agnes 2.0 Flash", + contextLength: 262144, maxOutputTokens: 65536, supportsReasoning: true, supportsVision: true, toolCalling: true, - interleavedField: "reasoning_content", }, { id: "agnes-2.5-flash", diff --git a/tests/unit/agnes-provider.test.ts b/tests/unit/agnes-provider.test.ts index 90e9a26047..8d4bdc52e0 100644 --- a/tests/unit/agnes-provider.test.ts +++ b/tests/unit/agnes-provider.test.ts @@ -27,7 +27,7 @@ test.after(() => { fs.rmSync(TEST_DATA_DIR, { recursive: true, force: true }); }); -const AGNES_RESPONSES_URL = "https://apihub.agnes-ai.com/v1/responses"; +const AGNES_CHAT_URL = "https://apihub.agnes-ai.com/v1/chat/completions"; test("agnes is registered as an API-key provider with complete metadata", () => { const entry = APIKEY_PROVIDERS.agnes; @@ -44,31 +44,31 @@ test("agnes is registered as an API-key provider with complete metadata", () => assert.ok(entry.authHint, "authHint must be defined"); }); -test("agnes registry entry uses Responses format with bearer API-key auth", () => { +test("agnes registry entry uses OpenAI Chat Completions format with bearer API-key auth", () => { const entry = providerRegistry.agnes; assert.ok(entry, "providerRegistry.agnes must be defined"); assert.equal(entry.id, "agnes"); - assert.equal(entry.format, "openai-responses"); + assert.equal(entry.format, "openai"); assert.equal(entry.executor, "default"); assert.equal(entry.authType, "apikey"); assert.equal(entry.authHeader, "bearer"); - assert.equal(entry.baseUrl, AGNES_RESPONSES_URL); + assert.equal(entry.baseUrl, AGNES_CHAT_URL); }); -test("agnes routes Chat Completions clients through its Responses upstream", () => { +test("agnes routes Chat Completions clients through its OpenAI chat upstream", () => { const { targetFormat } = resolveChatCoreTargetFormat({ provider: "agnes", - resolvedModel: "agnes-2.5-pro", + resolvedModel: "agnes-2.5-flash", apiFormat: undefined, sourceFormat: "openai", customModelTargetFormat: undefined, providerSpecificData: null, }); - assert.equal(targetFormat, "openai-responses"); + assert.equal(targetFormat, "openai"); assert.equal( - new DefaultExecutor("agnes").buildUrl("agnes-2.5-pro", true, 0, null), - AGNES_RESPONSES_URL + new DefaultExecutor("agnes").buildUrl("agnes-2.5-flash", true, 0, null), + AGNES_CHAT_URL ); }); @@ -76,33 +76,34 @@ test("agnes ships the current public chat models with correct capabilities", () const entry = providerRegistry.agnes; assert.deepEqual( entry.models.map((model) => model.id), - ["agnes-2.5-pro", "agnes-2.5-flash"] + ["agnes-1.5-flash", "agnes-2.0-flash", "agnes-2.5-flash"] ); + const flash15 = entry.models.find((m) => m.id === "agnes-1.5-flash"); + assert.ok(flash15, "agnes-1.5-flash must be defined"); + assert.equal(flash15.contextLength, 262144); + assert.equal(flash15.maxOutputTokens, 65536); + assert.equal(flash15.supportsVision, true); + assert.equal(flash15.toolCalling, true); + + const flash20 = entry.models.find((m) => m.id === "agnes-2.0-flash"); + assert.ok(flash20, "agnes-2.0-flash must be defined"); + assert.equal(flash20.contextLength, 262144); + assert.equal(flash20.maxOutputTokens, 65536); + assert.equal(flash20.supportsReasoning, true); + assert.equal(flash20.supportsVision, true); + assert.equal(flash20.toolCalling, true); + const flash25 = entry.models.find((m) => m.id === "agnes-2.5-flash"); assert.ok(flash25, "agnes-2.5-flash must be defined"); assert.equal(flash25.contextLength, 524288); assert.equal(flash25.maxOutputTokens, 65536); - assert.equal(flash25.supportsReasoning, true); - assert.equal(flash25.supportsVision, true); - assert.equal(flash25.toolCalling, true); - assert.equal(flash25.interleavedField, "reasoning_content"); - - const pro25 = entry.models.find((model) => model.id === "agnes-2.5-pro"); - assert.ok(pro25, "agnes-2.5-pro must be defined"); - assert.equal(pro25.contextLength, 1048576); - assert.equal(pro25.maxOutputTokens, 65536); - assert.equal(pro25.supportsReasoning, true); - assert.equal(pro25.supportsVision, true); - assert.equal(pro25.toolCalling, true); - assert.equal(pro25.interleavedField, "reasoning_content"); }); - test("agnes free catalog exposes the current free chat models through one shared pool", () => { const rows = FREE_MODEL_BUDGETS.filter((model) => model.provider === "agnes"); assert.deepEqual( rows.map((model) => model.modelId), - ["agnes-2.5-pro", "agnes-2.5-flash"] + ["agnes-1.5-flash", "agnes-2.0-flash", "agnes-2.5-flash"] ); assert.ok(rows.every((model) => model.poolKey === "agnes-free")); });