Skip to content

fix(api): advertise built-in auto/* combos in /v1/models (#4164) - #4170

Merged
diegosouzapw merged 1 commit into
release/v3.8.29from
fix/4164-auto-combos-catalog
Jun 18, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.29from
fix/4164-auto-combos-catalog

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Closes #4164

Problem

OmniRoute ships a zero-setup auto/* catalog (auto/best-coding, auto/best-reasoning, auto/pro-coding, … — 16 AUTO_TEMPLATE_VARIANTS in open-sse/services/autoCombo/builtinCatalog.ts) that the dashboard advertises and that resolve on demand via createBuiltinAutoCombo. But /v1/models (src/app/api/v1/models/catalog.ts) only emitted persisted DB combos + provider models, so clients that build their model picker from /v1/models — e.g. Hermes Agent (hermes model) — never saw any auto/* option.

Fix

The catalog now emits every AUTO_TEMPLATE_VARIANTS id (as owned_by: "combo") at the top of the list, before persisted combos and provider models. A shared listedIds set dedupes them so a persisted user combo can't shadow or double a built-in auto/* id.

Showing each auto/*'s dynamically-selected members (the reporter's secondary ask) is a separate enhancement — those are resolved per-request by the 9-factor scorer and have no fixed membership to list.

Test (TDD, Hard Rule #18)

tests/unit/models-catalog-auto-combos-4164.test.ts:

  • every AUTO_TEMPLATE_VARIANTS id is advertised (imports the source-of-truth list, so it can't drift);
  • the auto/* entries sit at the top of the list;
  • auto/* ids are unique.

RED 2/3 → GREEN 3/3. Catalog route regression 45/45 (aligned the existing 'context_length for individual chat models' test to exclude owned_by: "combo" entries — combos/routers resolve dynamically and have no fixed context_length, so they are categorically not individual chat models; this is alignment, not masking). typecheck:core, eslint, check:file-size clean. The failing vitest ecosystem.test.ts › model catalog is environmental (ECONNREFUSED :20128, needs a live server), not from this change.

OmniRoute ships a zero-setup auto/* catalog (auto/best-coding, auto/pro-
reasoning, …, 16 AUTO_TEMPLATE_VARIANTS) that the dashboard advertises and that
resolve on demand via createBuiltinAutoCombo, but the /v1/models listing only
emitted persisted DB combos + provider models. Clients that build their model
picker from /v1/models (e.g. Hermes Agent) never saw any auto/* option.

The catalog now emits every AUTO_TEMPLATE_VARIANTS id (owned_by: combo) at the
top of the list, deduped against persisted combos so a user combo can't shadow
or double a built-in id.

TDD: tests/unit/models-catalog-auto-combos-4164.test.ts asserts every auto/*
variant is advertised, they sit at the top, and ids are unique (RED 2/3 ->
GREEN 3/3). Aligned the existing 'context_length for individual chat models'
test to exclude owned_by:combo entries (combos/routers resolve dynamically and
have no fixed context_length — they are not individual chat models).
@diegosouzapw
diegosouzapw force-pushed the fix/4164-auto-combos-catalog branch from 80005c1 to 457eed5 Compare June 18, 2026 13:42

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request advertises the built-in, zero-setup auto/* combos at the top of the /v1/models endpoint listing to ensure clients can discover them, while also preventing duplicates from shadowing persisted database combos. It includes comprehensive unit tests to verify this behavior and updates existing tests accordingly. The reviewer noted a minor improvement opportunity to remove a redundant check inside the loop that populates the auto/* variants, as the set is empty at initialization and the keys are already unique.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +664 to +665
if (listedIds.has(autoId)) continue;
listedIds.add(autoId);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The check if (listedIds.has(autoId)) continue; is redundant here. listedIds is initialized as an empty Set immediately before this loop, and Object.keys(AUTO_TEMPLATE_VARIANTS) returns unique keys. Therefore, listedIds.has(autoId) will always evaluate to false during this loop. We can safely remove this check to simplify the code.

Suggested change
if (listedIds.has(autoId)) continue;
listedIds.add(autoId);
listedIds.add(autoId);

@diegosouzapw
diegosouzapw merged commit 0fc305e into release/v3.8.29 Jun 18, 2026
4 checks passed
diegosouzapw pushed a commit that referenced this pull request Jun 18, 2026
…4180)

Integrated into release/v3.8.29 — default includeThoughts for modern Gemini (2.5+) in the openai->gemini translator, so the model's reasoning is marked thought:true and routed to reasoning_content instead of leaking into visible content (#4170). Thanks @dhaern! On review we regenerated the gemini golden snapshots (basic-chat/with-system) and committed the new modern-gemini-default-thinking snapshot. 61/61 translator + golden tests pass; eslint clean. Respects explicit client thinking config (only applies when none is set) and excludes gemini-1.x / non-thinking 2.0.
@diegosouzapw
diegosouzapw deleted the fix/4164-auto-combos-catalog branch June 19, 2026 12:07
diegosouzapw added a commit to rafaumeu/OmniRoute that referenced this pull request Jul 12, 2026
…njection

Merge origin/release/v3.8.47 and resolve conflict in openai-to-gemini.ts:
the budget_tokens:0 drop (defect 1) was already fixed on release via cheaper-inference#6821
with a stricter includeThoughts check, so this drops the redundant/inferior
duplicate here and keeps the already-merged version (plus the gemma-4 guard
from cheaper-inference#6708).

Rework the default-thinkingConfig-injection fix (defect 2) so it does not
regress the cheaper-inference#4170 golden invariant: modern Gemini 2.5+ models think by
default even with no thinkingConfig sent, so the no-knob-at-all case must
keep injecting includeThoughts:true (unchanged from release). The real,
golden-safe delta for cheaper-inference#6813 defect 2 is an explicit off-switch:
reasoning_effort:"none" now maps to thinkingBudget:0/includeThoughts:false
in the OpenAI-format branch, giving callers a documented way to opt out
without touching the no-knob default path.

Also drops the dead `reasoning_effort === "none" ? 0 : defaultBudget`
ternary from the default-injection block — unreachable since block 1
already handles every truthy reasoning_effort value, including "none".

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…erence#4164) (cheaper-inference#4170)

OmniRoute ships a zero-setup auto/* catalog (auto/best-coding, auto/pro-
reasoning, …, 16 AUTO_TEMPLATE_VARIANTS) that the dashboard advertises and that
resolve on demand via createBuiltinAutoCombo, but the /v1/models listing only
emitted persisted DB combos + provider models. Clients that build their model
picker from /v1/models (e.g. Hermes Agent) never saw any auto/* option.

The catalog now emits every AUTO_TEMPLATE_VARIANTS id (owned_by: combo) at the
top of the list, deduped against persisted combos so a user combo can't shadow
or double a built-in id.

TDD: tests/unit/models-catalog-auto-combos-4164.test.ts asserts every auto/*
variant is advertised, they sit at the top, and ids are unique (RED 2/3 ->
GREEN 3/3). Aligned the existing 'context_length for individual chat models'
test to exclude owned_by:combo entries (combos/routers resolve dynamically and
have no fixed context_length — they are not individual chat models).
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…heaper-inference#4180)

Integrated into release/v3.8.29 — default includeThoughts for modern Gemini (2.5+) in the openai->gemini translator, so the model's reasoning is marked thought:true and routed to reasoning_content instead of leaking into visible content (cheaper-inference#4170). Thanks @dhaern! On review we regenerated the gemini golden snapshots (basic-chat/with-system) and committed the new modern-gemini-default-thinking snapshot. 61/61 translator + golden tests pass; eslint clean. Respects explicit client thinking config (only applies when none is set) and excludes gemini-1.x / non-thinking 2.0.
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.

1 participant