Skip to content

fix(vision): honor Custom Models vision flag on advertised aliases - #12974

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.51from
HouMinXi:fix/custom-vision-bridge-12758
Sep 11, 2026
Merged

diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.51from
HouMinXi:fix/custom-vision-bridge-12758

Conversation

@HouMinXi

@HouMinXi HouMinXi commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Bug Description

A Custom Models row with "Vision capable" checked still had its image
requests swapped to glm/glm-4.6v when the client sent the advertised
alias (vllm/orcarouter/...) or the bare path-shaped id. Only the
internal providerId/modelPath form skipped the bridge. Text chat
already resolved the same custom row; Vision Bridge used a narrower
lookup.

parseModel splits on the first /, so orcarouter/Qwen... becomes
provider orcarouter. The override lives under the openai-compatible
connection id. The matcher now recovers that row for all three id forms
without changing parseModel.

Fixes #12758

Changes

  • Lift custom-model vision lookup into customVisionOverride.ts (frozen
    models.ts cannot grow).
  • Match stored connectionId + path id against advertised alias, bare
    path, and full internal id.
  • Conflicting true/false hits for the same path return null (unknown),
    not a coin flip.

Test plan

  • tests/unit/vision-bridge-custom-path-id-12758.test.ts: three id
    forms skip the glm swap; explicit supportsVision: false still wins
    on the advertised alias.
  • Regression: api-models-hide-paid-6328, custom-vision-override-combo-routing-9195.

HouMinXi added a commit to HouMinXi/OmniRoute that referenced this pull request Sep 7, 2026
HouMinXi added a commit to HouMinXi/OmniRoute that referenced this pull request Sep 10, 2026
@HouMinXi
HouMinXi force-pushed the fix/custom-vision-bridge-12758 branch from e5c6e70 to d422745 Compare September 10, 2026 11:22
HouMinXi added a commit to HouMinXi/OmniRoute that referenced this pull request Sep 10, 2026
@HouMinXi
HouMinXi force-pushed the fix/custom-vision-bridge-12758 branch from d422745 to bc1e301 Compare September 10, 2026 13:23
Vision Bridge swapped image requests for path-shaped custom models to
glm/glm-4.6v when the client sent the advertised alias or the bare
path. parseModel splits on the first slash; the override lives under
the openai-compatible connection id. Match all three id forms without
changing parseModel.

Fixes diegosouzapw#12758

Signed-off-by: Minxi Hou <houminxi@gmail.com>
@HouMinXi
HouMinXi force-pushed the fix/custom-vision-bridge-12758 branch from bc1e301 to f910a78 Compare September 11, 2026 08:33
@HouMinXi

Copy link
Copy Markdown
Contributor Author

CI red on this PR matches current release/v3.8.51, not the unique files in the diff.

Measured on tip af49d4972 (#12925) against the HouMinXi open set:

  • Docs Gates: live provider modules 358 vs docs/SVG still saying 356; cli-tunnel skill dry-run out of date.
  • Fast Quality: open-sse/services/autoCombo/__tests__/autoCombo.test.ts TS2739 vs frozen baseline 0; pack-policy follows that.
  • ESLint: tests/unit/volcengine-plan-binding-upsert.test.ts @typescript-eslint/no-explicit-any (file is on tip).
  • Unit shards: chat-rate-limit-body-lock, antigravity-missing-project-chat, chat-rejects-image-only-model, stream-handler-public-error-boundary (and the glm GLM_STREAM_BUFFER_BYTES assert, which fix(stream): accept the buffer size glm.ts has been passing since #12179 #12925 already landed on tip).

Unique diff does not touch those files. Contributor-only; not merging.

@diegosouzapw
diegosouzapw merged commit 73dee8d into diegosouzapw:release/v3.8.51 Sep 11, 2026
8 of 16 checks passed
@HouMinXi
HouMinXi deleted the fix/custom-vision-bridge-12758 branch September 16, 2026 14:02
Githab-capibara added a commit to Githab-capibara/OmniRoute that referenced this pull request Sep 17, 2026
…iegosouzapw#12974)

`parseModel` splitting on the first `/` is the trap, and recovering the custom row for all three id forms without changing `parseModel` is the right way around it — that function has too many callers to widen. Lifting the lookup into `customVisionOverride.ts` because `models.ts` is frozen is the correct response to the cap, not a workaround.

---

Validated in one consolidated worktree cut from `release/v3.8.51`, boarded with the other 19 PRs of this batch. Two in-batch conflicts, both additive and resolved by keeping each side: the `ENVIRONMENT.md` table (diegosouzapw#13035 + diegosouzapw#13011) and the `chatHelpers.ts` import block (diegosouzapw#12975 on the tip + diegosouzapw#13017).

- `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK; `check:docs-counts` migrations ✓
- complexity 2816 / baseline 3218 and cognitive-complexity 1271 / baseline 1437 — both under baseline
- 531 of 532 focused assertions green across the batch's 46 test files
- `check-file-size` rebaselined for the batch's real growth (annotation `_rebaseline_2026_09_11_mergebatch_v3851_houminxi`, landed on diegosouzapw#13038), attributed per PR

The single red is **not this batch**: `tests/unit/combo/quota-weighted-strategy.test.ts` → "A/B isolation: 7 hard-empty + 2 at 0.5% + 1 at 40%, floor=1" asserts an order between two connections of identical weight and flakes on the pure tip too — 2 failures in 4 runs at `origin/release/v3.8.51` with nothing from this batch applied.

⚠️ base-red inherited: diegosouzapw#12732 — `Docs Gates`, `Merge integrity`, `No new ESLint warnings`, `Unit Tests fast-path` and `Fast Quality Gates` reproduce on the pure tip (provider count 356 vs the 358 the modules define, SKILL.md drift, and `open-sse/utils/stream.ts` at 3115 > frozen 3098, untouched here).

Thanks @HouMinXi — the live evidence on these (X500 logs, `storage.sqlite` state, real `/v1/models` probes, the 36-minute outage write-up) is what let a 20-PR batch be reviewed as a unit.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…iegosouzapw#12974)

`parseModel` splitting on the first `/` is the trap, and recovering the custom row for all three id forms without changing `parseModel` is the right way around it — that function has too many callers to widen. Lifting the lookup into `customVisionOverride.ts` because `models.ts` is frozen is the correct response to the cap, not a workaround.

---

Validated in one consolidated worktree cut from `release/v3.8.51`, boarded with the other 19 PRs of this batch. Two in-batch conflicts, both additive and resolved by keeping each side: the `ENVIRONMENT.md` table (diegosouzapw#13035 + diegosouzapw#13011) and the `chatHelpers.ts` import block (diegosouzapw#12975 on the tip + diegosouzapw#13017).

- `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK; `check:docs-counts` migrations ✓
- complexity 2816 / baseline 3218 and cognitive-complexity 1271 / baseline 1437 — both under baseline
- 531 of 532 focused assertions green across the batch's 46 test files
- `check-file-size` rebaselined for the batch's real growth (annotation `_rebaseline_2026_09_11_mergebatch_v3851_houminxi`, landed on diegosouzapw#13038), attributed per PR

The single red is **not this batch**: `tests/unit/combo/quota-weighted-strategy.test.ts` → "A/B isolation: 7 hard-empty + 2 at 0.5% + 1 at 40%, floor=1" asserts an order between two connections of identical weight and flakes on the pure tip too — 2 failures in 4 runs at `origin/release/v3.8.51` with nothing from this batch applied.

⚠️ base-red inherited: diegosouzapw#12732 — `Docs Gates`, `Merge integrity`, `No new ESLint warnings`, `Unit Tests fast-path` and `Fast Quality Gates` reproduce on the pure tip (provider count 356 vs the 358 the modules define, SKILL.md drift, and `open-sse/utils/stream.ts` at 3115 > frozen 3098, untouched here).

Thanks @HouMinXi — the live evidence on these (X500 logs, `storage.sqlite` state, real `/v1/models` probes, the 36-minute outage write-up) is what let a 20-PR batch be reviewed as a unit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Direct (non-combo) requests to a custom OpenAI-compatible model ignore supportsVision and force-route images to hardcoded glm/glm-4.6v

2 participants