Files
OmniRoute/tests
BillyOutlast f6b314cf9d fix(cache): port #12885 truncated-completion write guard into dual-layer cache
Ports the single-layer cache's #12885 fix into both write paths of
the new dual-layer architecture: a response cut short by the output
token ceiling (finish_reason "length"/"max_tokens") is a partial
answer, not a reusable one, so it must never be written to the
semantic cache. Caching it under a temperature:0 signature pinned
the truncation for every later identical request.

- src/lib/semanticCache.ts: new isTruncatedCompletion() predicate.
- semanticCacheStore.ts / streamingSemanticCacheStore.ts: gate both
  the legacy setCachedResponse() write and the new dual-layer
  manager.store() write on it.

Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-09-16 02:17:58 -03:00
..