Files
OmniRoute/docs/reference
Diego Rodrigues de Sa e Souza fcc63c48db feat(db): models/5004 — self-correcting model context-window overrides
A persisted per-(provider, model_id) override now wins over the static catalog /
models.dev sync in getModelContextLimit, so a model whose real context window diverges
from the catalog resolves correctly across combo routing, pre-flight compression, and
family fallback.

- migration 110_model_context_overrides + src/lib/db/modelContextOverrides.ts (CRUD,
  cacheless, defensive: null when the table is pre-migration; rejects non-positive windows).
- read-path: getModelContextLimit returns override ?? catalog; getResolvedModelCapabilities
  stays override-free so the reconciler can compare against it.
- src/lib/contextWindowResolver.ts: pure reconcileContextWindows (deps injected) +
  runContextWindowReconcile (reuses getAllSyncedAvailableModels — provider /models
  discovery, no new fetch) + periodic job. Writes auto:discovery overrides only when the
  discovered window diverges from the catalog; never touches manual overrides; self-heals.
- registered in instrumentation-node.ts (CONTEXT_WINDOW_RECONCILE_INTERVAL, 0 disables).

TDD: DB round-trip (7), read-path precedence (3), reconcile logic (6). Consumer suites
green; typecheck:core + lint + cycles + migration-numbering + env-doc-sync clean.
2026-06-30 14:55:54 -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-30 06:54:29 -03:00
2026-06-16 01:00:40 -03:00
2026-06-30 06:54:29 -03:00