fix(vision-bridge): force bridge for tokenrouter deepseek models (#3946)

Integrated into release/v3.8.27
This commit is contained in:
WormAlien
2026-06-16 15:46:02 +03:00
committed by GitHub
parent 5714640546
commit 2d498c28ae
2 changed files with 13 additions and 0 deletions

View File

@@ -17,6 +17,11 @@ const FORCED_VISION_BRIDGE_MODELS = new Set<string>([
"opencode-go/qwen3.5-plus",
"opencode-zen/deepseek-v4-flash",
"opencode-zen/deepseek-v4-pro",
// tokenrouter provider: upstream models overstate vision support.
// Force Vision Bridge so images are routed through the configured
// vision model instead of being passed through to text-only backends.
"tokenrouter/deepseek-v4-pro",
"tokenrouter/deepseek-v4-flash",
]);
export function isVisionBridgeForcedModel(model: string | null | undefined): boolean {

View File

@@ -39,6 +39,14 @@ test("isVisionBridgeForcedModel does not blanket-force GPT-family models", () =>
assert.strictEqual(isVisionBridgeForcedModel("openai/gpt-4o-mini"), false);
});
test("isVisionBridgeForcedModel forces tokenrouter deepseek models (text-only backend, #3946)", () => {
// These route through a Fireworks text-only backend that overstates vision
// support at the provider level, so they must be force-bridged or raw image
// data leaks to a backend that cannot process it.
assert.strictEqual(isVisionBridgeForcedModel("tokenrouter/deepseek-v4-pro"), true);
assert.strictEqual(isVisionBridgeForcedModel("tokenrouter/deepseek-v4-flash"), true);
});
test("getVisionBridgeConfig returns defaults when no settings provided", () => {
const config = getVisionBridgeConfig({});