mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-12 02:02:13 +03:00
A custom chat model registered via the dashboard with the `supportsVision: true` flag (persisted by addCustomModel / replaceCustomModels in src/lib/db/models.ts since #4264) now surfaces `capabilities.vision: true` in `/v1/models`, so the LLM selector and downstream vision routing treat it as vision-capable. Previously the `/v1/models` catalog only checked the conservative id-based `isVisionModelId` heuristic and ignored the explicit per-model flag, so a custom model whose id did not match the heuristic (e.g. `my-vision-llm`) appeared as text-only even when explicitly marked vision in the dashboard. The two custom-chat-model emission sites (alias and canonical) now call the new pure exported helper `getCustomVisionCapabilityFields` which: - returns vision fields when `entry.supportsVision === true`, OR - falls back to the existing id-based heuristic for backwards-compat, - respects an explicit `supportsVision === false` as a downgrade override (same anti-false-positive discipline as #4071 / #4072). `CustomModelEntry` gains the `supportsVision?: boolean` field already present on the persistence layer. Covered by tests/unit/llm-selector-custom-vision-models.test.ts (5 cases: helper export, flag-true unblock, id-heuristic preserved, no signal yields nothing, explicit-false downgrade). Inspired-by: https://github.com/decolua/9router/commit/5e5e78d3 Co-authored-by: Sutarto Jordan Chrisfivo <Jordannst@users.noreply.github.com>