fix: key prompt-cache affinity on git root, not cwd - #659
Closed
justrach wants to merge 1 commit into
Closed
Conversation
xAI partitions cache by prompt_cache_key. Hashing the leaf cwd made every graff-evals sandbox a cold ~8k write (rematch first-call cache 0–512 vs grok 11k–43k already warm). Seed is the git root so worktrees and sibling sandboxes share; scratch -p uses graff-scratch. Prefix bytes still have to match. ADR 0011.
justrach
marked this pull request as ready for review
August 28, 2026 06:33
This was referenced Aug 28, 2026
Owner
Author
|
Already on main (git-root cache affinity). Closing as superseded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prompt-cache max was already on (ADR 0011: stable catalog,
/btwparent key, child role lanes). The rematch still paid a cold ~8k on every first call becauseprompt_cache_keyhashed the leaf cwd.xAI partitions cache by that key. Sibling graff-evals sandboxes have the same system+tools prefix and different paths, so every task was a first-request write (cache 0–512). Grok-build’s first calls arrived already warm (11k–43k).
Change
Root affinity (
x-grok-conv-id/prompt_cache_key) is now:graff-scratchwhen there is no repo (scratch-pshares)Prefix bytes still have to match. A repo
CLAUDE.mddoes not hit another repo. Children still use role lanes, not the root id./cachenames the lever. ADR 0011 updated so this does not get “fixed” back to cwd.