mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-21 14:22:14 +03:00
PR #12630 (feat(cache): configurable dual-layer semantic caching) was opened 2026-09-03 with head at1cd8897e8and is now mergeable: CONFLICTING because upstream's release/v3.8.51 advanced 96 commits toba597b631. This merge brings semantic-cache up to date so the PR becomes mergeable again. Three conflicts resolved: - open-sse/handlers/chatCore.ts: took upstream. Upstream's restructure preserves storeSemanticCacheResponse at line 5365 and saveIdempotency at line 5379; the PR's Phase 9.1/9.2 block at lines 5528-5543 is textually equivalent and superseded by the upstream version. - src/app/api/settings/cache-config/route.ts: combined. Took upstream's restructured file as base (empty-check guard, alwaysPreserveClientCache routed through flat settings — keeping upstream commit 8a95a2b's fix for the runtime no-op bug), then restored the PR's dual-layer cache content on top: resetSemanticCacheManager call, ensureSemanticCacheDbBridge() module-level side-effect, getEmbeddingOptions enrichment in GET, the 10 new cache schema fields (semanticCacheBackend, semanticCacheThreshold, semanticCacheEmbeddingProvider/Model/Dimension/BaseUrl/ApiKey, semanticCacheRedisUrl/Prefix, semanticCacheRequireZeroTemp), and matching CACHE_CONFIG_KEYS + DEFAULTS entries. alwaysPreserveClientCache stays in the flat-settings path per upstream's fix. - src/app/(dashboard)/dashboard/combos/page.tsx: took upstream. The useState+useEffect localStorage hydration pattern is replaced by useSyncExternalStore (no commit-after-mount, no hydration mismatch warning). Skipped from this PR: the bf8691afe lint cleanup for tests/unit/volcengine-plan-binding-upsert.test.ts (upstream's file, not touched by the PR) will go in as a separate upstream PR. Forward-merge base-red inherited: #12732 (upstream's tip is red).