mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-11 09:42:15 +03:00
fix(types): validate Vision Bridge combo names (#9565)
Merge-train validated (tip 6ce4effef8). Vitest failures confirmed as base-red (#9679).
This commit is contained in:
@@ -28,6 +28,11 @@ export { isProviderConnectionUsable, hasUsableCredentialsForModel };
|
||||
|
||||
type ComboVisionBridgeDecision = "process" | "skip" | "not-combo";
|
||||
|
||||
export function resolveVisionComboName(mapping: Record<string, unknown>): string | null {
|
||||
const comboName = mapping.comboName ?? mapping.name ?? null;
|
||||
return typeof comboName === "string" && comboName.length > 0 ? comboName : null;
|
||||
}
|
||||
|
||||
/// Check if a combo model should trigger vision bridge processing.
|
||||
/// Resolves combo targets and returns:
|
||||
/// - "process" if any target cannot be proven vision-capable
|
||||
@@ -45,7 +50,7 @@ async function getComboVisionBridgeDecision(model: string): Promise<ComboVisionB
|
||||
if (!combo) {
|
||||
const mapping = await resolveComboForModel(model);
|
||||
if (!mapping) return "not-combo";
|
||||
const comboName = mapping.comboName ?? mapping.name ?? null;
|
||||
const comboName = resolveVisionComboName(mapping);
|
||||
if (!comboName) return "not-combo";
|
||||
combo = await getComboByName(comboName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user