Skip to content

v0.3.15

Choose a tag to compare

@maverde73 maverde73 released this 28 Oct 09:39

Window guard fix for Strata / PolyStrata on small windows (#28, reported by @akohlsmith).

  • Recent Strata/PolyStrata encode special-token spellings quoted inside message text (for example a literal </think> in a file or log) as ordinary text, while the proxy counted each as one special token, even with the right tokenizer. The prompt was undercounted and a request could exceed the engine window (HTTP 400). The guard now adds a conservative reserve for these literals, in the single path shared by every upstream call (client requests, notes, seal, anchor, recall rounds, retries; streaming and not). A prompt that cannot be counted with a loaded tokenizer is refused before sending.
  • Oversized budgets on small windows are adapted at startup with a warning (response_floor and notes_max_tokens to at most window/4; anchor_min_tokens scaled below 128K), and check reports the same. A Strata window override larger than the engine's context is no longer honoured.
  • README: recommended 32K settings and the limits of local token-count guarantees.

Reproduced on CPU with a synthetic prompt (23,225 tokens + 9,765 output → 400 before; 9,435 output, within the window, after). The reporter's own prompt was not available, so this is the verified cause of that failure pattern, not proof that it explains every failure in that session.