Files
OmniRoute/@omniroute/opencode-plugin/tests
diegosouzapw fc49fbeb6b fix(providers): backfill combo context limit from snapshot after cold start (#13000)
Root cause was two-fold in @omniroute/opencode-plugin: (1) the static
catalog builder (buildStaticProviderEntry, used by
createOmniRouteConfigHook) computed a combo's limit.context purely as
Math.min(member context_length) and never consulted the server-computed
combo.computed_context_length field at all, unlike the dynamic hook's
mapComboToModelV2; (2) even where computed_context_length IS consulted,
a background refresh whose live /api/combos response comes back without
the field (e.g. right after a restart, before the server finishes
recomputing it) had no fallback to the last-known-good disk snapshot,
so it silently overwrote a correct 245000 limit with the degraded
Math.min(member) value (163840 in the reported case).

Fix: buildStaticProviderEntry now prefers computed_context_length the
same way mapComboToModelV2 does, and doRefresh() backfills a combo's
missing/zero computed_context_length from warmSnapshot.rawCombos by id
before caching/publishing/persisting, scoped to that single field only.

Regression test:
@omniroute/opencode-plugin/tests/issue-13000-cold-start-combo-limit.test.ts
2026-09-15 14:04:25 -03:00
..
2026-06-23 03:08:29 -03:00
2026-06-29 08:40:06 -03:00
2026-06-23 03:08:29 -03:00
2026-06-23 03:08:29 -03:00
2026-05-23 01:46:59 -03:00