feat(headroom): make the compression request timeout configurable

The 3000 ms timeout on /v1/compress was fixed, so busy or slow machines
timed out often and sent the LLM an inconsistently compressed body,
hurting prompt caching. Add a headroomTimeoutMs setting, thread it from
the chat handler down to compressWithHeadroom, expose it in the Token
Saver dashboard, and normalize invalid values back to the 3000 ms default.
This commit is contained in:
snower
2026-08-28 16:30:25 +07:00
parent 28d005772a
commit 993c6eb469
6 changed files with 128 additions and 2 deletions

View File

@@ -53,6 +53,7 @@ const DEFAULT_SETTINGS = {
headroomEnabled: false,
headroomUrl: DEFAULT_HEADROOM_URL,
headroomCompressUserMessages: false,
headroomTimeoutMs: 3000,
cavemanEnabled: false,
cavemanLevel: "full",
ponytailEnabled: false,