From 2310ad4b14cd0fab45142cf776684c037d073651 Mon Sep 17 00:00:00 2001 From: Nikan Wystaf Date: Mon, 28 Sep 2026 19:31:05 +0700 Subject: [PATCH] feat(agnes): seed the 2.5/3.0 model ids in the registry --- open-sse/providers/registry/agnes.js | 13 +++++++-- tests/unit/agnes-model-seeds.test.js | 40 ++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 tests/unit/agnes-model-seeds.test.js diff --git a/open-sse/providers/registry/agnes.js b/open-sse/providers/registry/agnes.js index 4cf2a88e..633d67c6 100644 --- a/open-sse/providers/registry/agnes.js +++ b/open-sse/providers/registry/agnes.js @@ -23,7 +23,16 @@ export default { baseUrl: "https://apihub.agnes-ai.com/v1/chat/completions", validateUrl: "https://apihub.agnes-ai.com/v1/models", }, - // No model ids could be verified without a key, so discovery is left to the - // live endpoint and any id is accepted through passthroughModels. + // Seeds so the dashboard has something to show before a key is saved and + // /v1/models answers with a usable list. The live catalogue at + // apihub.agnes-ai.com/v1/models requires a token (401 "Token not provided"), + // so these ids are a curated starting set rather than a verified dump — + // passthroughModels below still accepts any id the account actually has. + models: [ + { id: "agnes-2.5-flash", name: "Agnes 2.5 Flash" }, + { id: "agnes-2.5-pro", name: "Agnes 2.5 Pro" }, + { id: "agnes-2.5-pro-beta", name: "Agnes 2.5 Pro Beta" }, + { id: "agnes-3.0-flash", name: "Agnes 3.0 Flash" }, + ], passthroughModels: true, }; diff --git a/tests/unit/agnes-model-seeds.test.js b/tests/unit/agnes-model-seeds.test.js new file mode 100644 index 00000000..8a8a0e21 --- /dev/null +++ b/tests/unit/agnes-model-seeds.test.js @@ -0,0 +1,40 @@ +import { describe, expect, it } from "vitest"; + +import agnes from "../../open-sse/providers/registry/agnes.js"; + +// Seeds for Agnes AI. The live catalogue (apihub.agnes-ai.com/v1/models) +// answers 401 without a token, so these ids are a curated starting set and +// passthroughModels still accepts anything the account actually has. + +describe("agnes registry model seeds", () => { + it("declares the four 2.5/3.0 models", () => { + expect(agnes.models.map((m) => m.id)).toEqual([ + "agnes-2.5-flash", + "agnes-2.5-pro", + "agnes-2.5-pro-beta", + "agnes-3.0-flash", + ]); + }); + + it("gives every model a display name", () => { + for (const m of agnes.models) { + expect(typeof m.name, m.id).toBe("string"); + expect(m.name.length, m.id).toBeGreaterThan(0); + } + }); + + it("keeps passthroughModels so newer ids still work", () => { + expect(agnes.passthroughModels).toBe(true); + }); + + it("does not claim a modelsFetcher for an endpoint that needs a token", () => { + // /v1/models returns 401 "Token not provided" without auth, so a public + // modelsFetcher would just surface an error instead of a list. + expect(agnes.modelsFetcher).toBeUndefined(); + }); + + it("leaves transport untouched", () => { + expect(agnes.transport.baseUrl).toBe("https://apihub.agnes-ai.com/v1/chat/completions"); + expect(agnes.transport.validateUrl).toBe("https://apihub.agnes-ai.com/v1/models"); + }); +});