Files
OmniRoute/tests/unit/compression
Diego Rodrigues de Sa e Souza a72e1656eb fix(routing): bare model ids route to codex first; validate synced candidates (#9275)
* fix(routing): bare model ids route to codex first; validate synced candidates

Two bare-model-routing bugs surfaced in the field when an OmniRoute
deployment had a codex subscription whose cookie quota was exhausted
(retry-after 429047s / ~5 days) AND an active kiro connection whose
upstream sync briefly advertised 'claude-opus-5' before kiro vendored
it into the static registry.

  1. Bare 'gpt-5.6-sol' (and friends) routed to the codex provider even
     when the user had explicitly configured 'agentrouter' as their
     provider (via model_provider in codex CLI). With codex in cooldown,
     every bare request 429'd. Fix: extend CODEX_NATIVE_UNPREFIXED_MODELS
     to include the full gpt-5.6-sol tier set + gpt-5.5 + the related
     codex-native ids. The Codex CLI default is now actually honored;
     users can still prefix 'agentrouter/gpt-5.6-sol' to opt into a
     specific provider.

  2. Bare 'claude-opus-5' silently routed to 'kiro' when kiro's synced
     /v1/models catalog had that id (likely from a transient upstream
     quirk). kiro's static registry never cataloged claude-opus-5, so
     the upstream call 404'd. Fix: validate activeSyncedProviders against
     MODEL_TO_PROVIDERS before merging them into the candidate list.
     Auto-discovery still wins when the model id has no static entry
     (brand-new models from upstream keep working).

Bonus: when handleNoCredentials returns a 404 'No active credentials for
provider: X' error, surface the top-3 candidate aliases (e.g.
'anthropic/claude-opus-5, claude/claude-opus-5, agentrouter/claude-opus-5')
so the operator can pick a working prefix instead of staring at a wall.

Tests (all pass, 25 regression tests preserved):
  - tests/unit/fix-bare-model-precedence.test.ts (7 tests)
  - tests/unit/fix-synced-model-validation.test.ts (3 tests)
  - tests/unit/fix-error-message-candidates.test.ts (3 tests)
  - tests/unit/fix-bare-routing-fallback.test.ts (7 tests)

* fix(tests): replace lorem ipsum with neutral text to avoid agentrouter WAF

The agentrouter.org WAF blocks requests containing 'lorem ipsum' in
messages[].content. When Claude Code reads test files via the Read tool,
the content appears in tool_result blocks which can trigger the filter.

Replace 'lorem ipsum dolor sit amet' with 'example content for testing
purposes' in compression harness test to avoid false positives.

---------

Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
2026-08-03 18:09:31 -03:00
..
2026-06-30 06:54:29 -03:00
2026-06-15 03:32:11 -03:00
2026-06-09 22:57:12 -03:00
2026-06-28 06:58:29 -03:00
2026-06-28 06:58:29 -03:00
2026-06-27 09:07:12 -03:00
2026-06-29 08:40:06 -03:00
2026-06-21 08:56:51 -03:00
2026-06-23 17:06:18 -03:00
2026-06-23 17:06:18 -03:00
2026-06-23 17:06:18 -03:00
2026-06-23 17:06:18 -03:00
2026-06-23 17:06:18 -03:00
2026-06-23 17:06:18 -03:00
2026-06-23 17:06:18 -03:00
2026-06-23 17:06:18 -03:00
2026-06-27 09:07:12 -03:00
2026-06-27 09:07:12 -03:00
2026-06-27 09:07:12 -03:00
2026-06-19 06:49:01 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-27 09:07:12 -03:00
2026-06-27 09:07:12 -03:00
2026-06-07 07:20:02 -03:00
2026-06-09 15:56:24 -03:00
2026-07-02 10:47:13 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-07-02 10:47:13 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-27 09:07:12 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-20 07:09:43 -03:00
2026-07-02 10:47:13 -03:00
2026-06-19 06:49:01 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-19 06:49:01 -03:00
2026-06-29 08:40:06 -03:00
2026-06-30 06:54:29 -03:00
2026-06-28 06:58:29 -03:00
2026-06-23 17:06:18 -03:00
2026-06-19 06:49:01 -03:00