Repository navigation
feat(api): no-thinking gateway model IDs (FCC port, Fase 8.1) - #4145
Merged
Merged
Conversation
Some clients — most notably Claude Code — always attach a `thinking` block
to certain Claude models and offer no UI to turn it off. This adds a synthetic
gateway model id that forces a thinking-capable model into a no-thinking mode
purely by model selection:
claude-3-omniroute-no-thinking/<provider>/<model>
- New open-sse/utils/noThinkingAlias.ts: prefix predicates + request-side
applyNoThinkingAlias() (Claude path → thinking:{type:"disabled"}; OpenAI path
→ drop reasoning/reasoning_effort) + catalog-side appendNoThinkingVariants().
- /v1/models advertises the variant only for Claude-family models that support
thinking AND honor `disabled` (fable-5 et al. excluded). Variants inherit the
per-API-key allowlist of their base model.
- ModelSpec.noThinkingAlias?: boolean — explicit operator override (on/off).
- Wired at the single chokepoint in each file: handleChat (before model
resolution) and getUnifiedModelsResponse (after key filtering).
- The existing normalizeThinkingForModel() still runs downstream unchanged.
Tests: 12 unit (prefix round-trip, request suppression both formats, catalog
gating incl. fable-5/combo/double-alias exclusion). file-size rebaselined with
justification (catalog +5, chat +13 — thin wiring of tested helpers).
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
diegosouzapw
added a commit
that referenced
this pull request
Jun 18, 2026
… Fase 8.2) (#4146) Per-provider sliding-window rate-limit fallback (FCC port, Fase 8.2): opt-in (empty map = no-op), burst-free sliding window as a floor for header-less providers; Bottleneck still applies. Integrado em release/v3.8.29 (conflito de file-size-baseline resolvido por união com #4145).
diegosouzapw
added a commit
to megamen32/OmniRoute
that referenced
this pull request
Jun 18, 2026
Merge release/v3.8.29 and reconcile catalog.ts: the branch had drifted far behind and its snapshot would have reverted the centralized vision detection (cheaper-inference#4072), the no-thinking gateway variants (cheaper-inference#4145) and cheaper-inference#4164's own auto/* loop. Keep all of those and apply only the genuine improvement on top of release: enrich each cheaper-inference#4164 auto/* /v1/models entry with the combo's advertised context/output limits (createBuiltinAutoCombo → advertisedContextLength/ advertisedMaxOutputTokens, 128000/8192 fallback) + baseline capabilities, with a try/catch that emits the minimal cheaper-inference#4164 entry on resolve failure so the id is never dropped. OpenAI-compatible clients (Hermes) get a context window before the first request. Adds tests/unit/models-catalog-auto-combos-4164.test.ts::"cheaper-inference#4189 every auto/* entry exposes token limits + baseline capabilities" (Rule cheaper-inference#18) and bumps the catalog.ts file-size baseline 1440->1463 with justification. Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
diegosouzapw
pushed a commit
that referenced
this pull request
Jun 18, 2026
Integrated into release/v3.8.29. Thanks @megamen32! Reconciled on your branch: the branch had drifted behind release and would have reverted the centralized vision detection (#4072), the no-thinking gateway variants (#4145) and #4164's auto/* loop — those are kept, and your genuine improvement is applied on top: each auto/* /v1/models entry now carries advertised context/output limits + capabilities (createBuiltinAutoCombo, with a fallback to the minimal entry on resolve failure). Added a regression test (Rule #18) and bumped the catalog.ts file-size baseline 1440→1463 with justification.
This was referenced Jun 18, 2026
Merged
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…r-inference#4145) No-thinking gateway model IDs (FCC port, Fase 8.1): synthetic claude-3-omniroute-no-thinking/<provider>/<model> catalog id that resolves to the real model with reasoning suppressed. Integrado em release/v3.8.29.
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
… Fase 8.2) (cheaper-inference#4146) Per-provider sliding-window rate-limit fallback (FCC port, Fase 8.2): opt-in (empty map = no-op), burst-free sliding window as a floor for header-less providers; Bottleneck still applies. Integrado em release/v3.8.29 (conflito de file-size-baseline resolvido por união com cheaper-inference#4145).
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
Integrated into release/v3.8.29. Thanks @megamen32! Reconciled on your branch: the branch had drifted behind release and would have reverted the centralized vision detection (cheaper-inference#4072), the no-thinking gateway variants (cheaper-inference#4145) and cheaper-inference#4164's auto/* loop — those are kept, and your genuine improvement is applied on top: each auto/* /v1/models entry now carries advertised context/output limits + capabilities (createBuiltinAutoCombo, with a fallback to the minimal entry on resolve failure). Added a regression test (Rule cheaper-inference#18) and bumped the catalog.ts file-size baseline 1440→1463 with justification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fase 8.1 — Gateway model IDs no-thinking (porte free-claude-code)
Clientes como o Claude Code sempre anexam um bloco
thinkingem certos modelos Claude e não oferecem UI para desligá-lo. Esta PR expõe um model id sintético que força o modo no-thinking puramente por seleção de modelo:O que faz
applyNoThinkingAlias): ao receber o alias, reescrevebody.modelpara o<provider>/<model>real e suprime reasoning in-place —thinking:{type:"disabled"}no caminho/v1/messages; descartareasoning/reasoning_effortno/v1/chat/completions. Acontece antes de qualquer resolução de modelo / combo routing.appendNoThinkingVariants):/v1/modelsanuncia a variante apenas para modelos Claude-family que suportam thinking e honramdisabled. Modelos que rejeitamdisabled(ex.:claude-fable-5) e combos são excluídos — anunciar uma variante que ignora a supressão seria mentira. As variantes herdam o allowlist por API-key do modelo base.ModelSpec.noThinkingAlias?: boolean— operador força on/off por modelo (default = auto-regra acima).normalizeThinkingForModel()existente continua rodando downstream, inalterado.Arquitetura
Toda a lógica vive no novo
open-sse/utils/noThinkingAlias.ts(<cap). Os 2 pontos de integração são wiring fino de helpers testados, cada um no único chokepoint correto:handleChat(src/sse/handlers/chat.ts) — logo após lerbody.model, antes da resolução.getUnifiedModelsResponse(catalog.ts) — após o filtro de API-key.Testes (TDD, RED→GREEN)
12 testes unitários: round-trip do prefixo, supressão no request (ambos os formatos), gating do catálogo (exclusão de fable-5 / combo / double-alias). Mais 73 testes de regressão de model-specs/catalog/thinking verdes.
Escopo / segurança
anynovo (any-budget:t11 verde), sem ciclos.claude-3-omniroute-no-thinking/<provider>/<model>documentado emdocs/reference/API_REFERENCE.md.Validação
typecheck:core+typecheck:noimplicit:core(meus arquivos limpos; erros restantes são dívida pré-existente),eslint0,check:cycles/check:file-size/check:any-budget:t11/check:docs-syncverdes, 12 + 73 testes verdes.🤖 Generated with Claude Code