Step 1 of 4
Map what must be byte-identical
The cache matches prefixes; know exactly what is in yours.
Write out the full request structure your provider sees, in order: system prompt, tool definitions, conversation messages, and (last) the new content. Everything before the first differing byte is cacheable prefix - so the design goal is pushing all per-child variation to the very end. Inventory your current dispatch path for prefix pollution: timestamps or run ids in the system prompt, tool arrays rebuilt per child (set iteration order!), serialization that does not guarantee key order, permission-dependent tool filtering that differs per child, and configuration fields (thinking settings, verbosity) that default differently for children than the parent. Each finding is a work item for the next step. Also confirm your provider's cache granularity and minimum-prefix rules so you aim at real boundaries.
Expected after this step
A request-structure map with every source of prefix variation identified.
Should not happen
- ✕Per-child placeholder text ('processing task 1 of 3') breaking prefix identity
- ✕Re-running tool filtering for each child, changing array order and killing the cache
- ✕Injecting the child directive before the shared history instead of after
- ✕Assuming savings without measuring - one serialization change and you pay full price silently
Verify before continuing
Do not move on until every check is true. The complete button stays locked until then.
Do not continue if…
- !Per-child placeholder text ('processing task 1 of 3') breaking prefix identity
- !Re-running tool filtering for each child, changing array order and killing the cache
- !Injecting the child directive before the shared history instead of after
- !Assuming savings without measuring - one serialization change and you pay full price silently
If the AI messes this up
Use this when the AI fakes progress or breaks the feature. It forces a real fix.
You cannot find the variation but caches still miss. Capture two sibling requests raw (exact bytes on the wire) and binary-diff them - the culprit is usually invisible in logs: whitespace, field ordering, or a library re-serializing floats differently.