mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
* fix(api): enumerate tiered auto combo endpoints in /api/combos/auto The backend already supports auto/<category>[:<tier>] routing via suffixComposition.ts + virtualFactory.ts, but GET /api/combos/auto only exposed 6 flat variants. This adds a second loop enumerating the 10 curated AUTO_SUFFIX_VARIANTS (auto/coding:free, auto/coding:cheap, auto/coding:pro, auto/reasoning, auto/vision, etc.). Fixes #7619 * fix(combos): enumerate template and family auto variants in GET /api/combos/auto The endpoint was missing 27 auto variants that /v1/models already advertises, causing 404s when clients tried to use them: - 20 template variants (auto/best-coding, auto/pro-*, auto/claude-*, auto/best-free, etc.) - 7 family variants (auto/glm, auto/minimax, auto/mimo, auto/zai, auto/gemma, auto/llama, auto/gemini) Fixes #7619 Refs #6453 * fix(combos): swap Phase B/C ordering to match catalog.ts Template variants (Phase C) now enumerate before suffix variants (Phase B) so that overlapping ids like auto/reasoning and auto/vision use template resolution (variant-based) rather than suffix resolution (category-based), matching the behavior in catalog.ts. * fix(combos): fix comment labels and redundant as const * fix(compression): apply compression combo assignments to routing combos Routing combos (e.g. codex, free-only, or-free) use provider-prefixed model strings like codex/gpt-5.5 and go through handleSingleModelChat, which passes comboName: null, isCombo: false. The compression combo assignment lookup in chatCore.ts was gated behind if (isCombo && comboName), so routing combos never had their compression combos applied. Fix: - Add routingComboId parameter threaded through handleSingleModelChat → executeChatWithBreaker → handleChatCore - In handleChat(), resolve the routing combo UUID from the model string's provider prefix via getComboByName - In chatCore.ts, change the gate to (isCombo && comboName) || routingComboId and add routingComboId to the lookup key array Fixes #7771 * fix(autoCombo): guarantee positive maxOutputTokens fallback in computeAdvertisedLimits GET /api/combos/auto now enumerates auto/<family> variants (auto/llama, auto/glm, etc). computeAdvertisedLimits() already guaranteed a positive contextLength for any non-empty candidate pool via getTokenLimit()'s fallback chain, but had no equivalent fallback for maxOutputTokens — candidates whose registry entry and models.dev sync data both lack that field (common for no-auth/free-tier providers matching a family filter, e.g. llama-* on groq/bazaarlink/etc) left maxOutputTokens null, which tests/unit/auto-combo-context-advertising.test.ts catches as a contract violation of the endpoint (opencode disables smart auto-compaction when a limit is falsy — the same bug class this module's docstring already describes for contextLength). Fall back to a conservative generic default (4096) when no candidate in the pool resolves a known maxOutputTokens, mirroring the existing contextLength guarantee. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(autoCombo): align advertised max_output_tokens fallback with the catalog convention (8192) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * chore(quality): file-size baseline for chatHelpers routingComboId thread (876->877) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Erick Kinnee <erick@ekinnee.dev> Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>