mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-11 09:42:15 +03:00
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.