Files
079edc6182 fix(engine): isolate the prefix cache per tenant and cache only written KV (#119)
Prefix blocks were hashed from token content alone, so any two requests with the
same prefix shared KV across orgs, and the sequence-level cache and its disk spill
were keyed by tokens too. Every block hash, sequence-cache key and recurrent-prefix
key now carries the request's cache salt, which the server derives from the
gateway's X-Org-Id plus an optional cache_salt body field. Salted prefixes are
dropped instead of spilled to disk.

The scheduler also cached blocks no forward had written: a prompt preempted in the
pass that admitted it, the last sampled token's slot of every finished or preempted
sequence, and sequences that ended in error. Now only written positions become
reusable.

kv_isolation drives the real scheduler against a simulated KV store and checks every
read for unwritten, foreign-context or other-tenant KV; hanzo.yml gates on it.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-19 16:39:53 -05:00
..
2026-09-24 15:01:47 -07:00
2026-09-24 15:01:47 -07:00