mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-21 22:32:22 +03:00
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