From f8a17c4126352290a084b821356b754a08d26feb Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Date: Fri, 26 Jun 2026 10:53:27 -0300 Subject: [PATCH] feat(blackbox): refresh provider model catalog (#4935) Integrated into release/v3.8.38 (leva 5) --- CHANGELOG.md | 4 ++ .../providers/registry/blackbox/index.ts | 16 +++-- tests/unit/providers/blackbox.test.ts | 60 +++++++++++++++++++ 3 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 tests/unit/providers/blackbox.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d814826f2..8d22ee394b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ _In development — bullets added per PR; finalized at release._ +### ✨ New Features + +- **feat(blackbox):** refresh provider model catalog with latest models. (thanks @ptkelanatechsolutions) + ### 🔧 Bug Fixes - **fix(executors): strip `client_metadata` from forwarded body for Cerebras and Mistral** — Cerebras returns 400 (`wrong_api_format`) and Mistral returns 422 (`extra_forbidden`) when the passthrough body carries `client_metadata` (an OpenAI Codex / Claude CLI field with no equivalent on these upstreams). The default executor now drops it for these two providers before sending downstream; other providers (notably `openai`/`codex`) keep it. (thanks @saurabh321gupta) diff --git a/open-sse/config/providers/registry/blackbox/index.ts b/open-sse/config/providers/registry/blackbox/index.ts index db0f2e26ff..e5fba3d9f8 100644 --- a/open-sse/config/providers/registry/blackbox/index.ts +++ b/open-sse/config/providers/registry/blackbox/index.ts @@ -10,11 +10,15 @@ export const blackboxProvider: RegistryEntry = { authType: "apikey", authHeader: "bearer", models: [ - { id: "gpt-4o", name: "GPT-4o" }, - { id: "gemini-2.5-flash", name: "Gemini 2.5 Flash" }, - { id: "claude-sonnet-4", name: "Claude Sonnet 4" }, - { id: "deepseek-v3", name: "DeepSeek V3" }, - { id: "blackboxai", name: "Blackbox AI" }, - { id: "blackboxai-pro", name: "Blackbox AI Pro" }, + { id: "claude-fable-5", name: "Claude Fable 5" }, + { id: "claude-opus-4.8", name: "Claude Opus 4.8" }, + { id: "claude-sonnet-4.6", name: "Claude Sonnet 4.6" }, + { id: "gpt-5.5", name: "GPT-5.5" }, + { id: "gpt-5.4-pro", name: "GPT-5.4 Pro" }, + { id: "gpt-5.4", name: "GPT-5.4" }, + { id: "gpt-5.3-codex", name: "GPT-5.3 Codex" }, + { id: "gpt-5.4-nano", name: "GPT-5.4 Nano" }, + { id: "deepseek-v4-flash", name: "DeepSeek V4 Flash" }, + { id: "grok-4.3", name: "Grok 4.3" }, ], }; diff --git a/tests/unit/providers/blackbox.test.ts b/tests/unit/providers/blackbox.test.ts new file mode 100644 index 0000000000..0d305fb7bc --- /dev/null +++ b/tests/unit/providers/blackbox.test.ts @@ -0,0 +1,60 @@ +/** + * PR port #2038 (decolua/9router) — "feat(blackbox): overhaul provider with latest models" + * + * Asserts that the blackbox registry entry carries the refreshed model + * catalogue introduced by upstream PR #2038: + * - New model ids are present + * - Stale model ids that were replaced are absent + */ +import test from "node:test"; +import assert from "node:assert/strict"; + +const { REGISTRY } = await import("../../../open-sse/config/providerRegistry.ts"); + +const blackbox = (REGISTRY as Record>).blackbox; + +// New model ids from upstream PR #2038 (upstreamModelId / thinkingConfig fields +// are dropped — OmniRoute's RegistryModel only carries { id, name, ... }) +const NEW_MODEL_IDS = [ + "claude-fable-5", + "claude-opus-4.8", + "claude-sonnet-4.6", + "gpt-5.5", + "gpt-5.4-pro", + "gpt-5.4", + "gpt-5.3-codex", + "gpt-5.4-nano", + "deepseek-v4-flash", + "grok-4.3", +]; + +// Stale ids that the upstream PR replaced (were present before the overhaul) +const STALE_MODEL_IDS = [ + "gpt-4o", + "gemini-2.5-flash", + "claude-sonnet-4", + "deepseek-v3", + "blackboxai", + "blackboxai-pro", +]; + +test("blackbox provider is registered", () => { + assert.ok(blackbox, "blackbox should be present in the executor registry"); + assert.ok(Array.isArray(blackbox.models), "blackbox must expose a models array"); +}); + +for (const id of NEW_MODEL_IDS) { + test(`blackbox.models includes new model: ${id}`, () => { + const models = blackbox.models as { id: string; name: string }[]; + const found = models.find((m) => m.id === id); + assert.ok(found, `Expected model "${id}" to be present in blackbox.models`); + }); +} + +for (const id of STALE_MODEL_IDS) { + test(`blackbox.models does NOT include stale model: ${id}`, () => { + const models = blackbox.models as { id: string; name: string }[]; + const found = models.find((m) => m.id === id); + assert.equal(found, undefined, `Stale model "${id}" should be absent from blackbox.models`); + }); +}