mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-13 10:43:43 +03:00
Replace the implicit 3-state behaviour of the boolean preserveSystemPrompt with an
explicit authoritative enum, keeping the boolean as the engine-facing effective value:
- always -> never compress the system prompt (legacy true).
- whenNoCache -> compress it only when there is no cache to protect (legacy false; the
#3890/#3955 cache guard already did exactly this).
- never -> always compress the system prompt, even when it breaks a prompt cache (new).
The mode is resolved to the effective boolean at resolveCacheAwareConfig (already upstream
in chatCore with the caching context), generalizing the previous hard-coded force-true.
Back-compat shim derives the mode from the legacy boolean, so existing configs and the
cache-guard tests are behaviour-identical. Persisted in compression settings, validated by
Zod, exposed as a 3-way select in both compression panels.
New helper open-sse/services/compression/preserveSystemPromptMode.ts is the single source
of the enum<->boolean mapping. TDD: helper, cache-aware resolution incl. never, DB
round-trip, UI select render + save.