feat(blackbox): refresh provider model catalog (#4935)

Integrated into release/v3.8.38 (leva 5)
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-06-26 10:53:27 -03:00
committed by GitHub
parent 63a5bc9413
commit f8a17c4126
3 changed files with 74 additions and 6 deletions

View File

@@ -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)

View File

@@ -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" },
],
};

View File

@@ -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<string, Record<string, unknown>>).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`);
});
}