Improve provider-proxy cache determinism for read-only mode#7234
Open
AntoineToussaint wants to merge 4 commits intoaaron/provider-proxy-require-cachefrom
Open
Improve provider-proxy cache determinism for read-only mode#7234AntoineToussaint wants to merge 4 commits intoaaron/provider-proxy-require-cachefrom
AntoineToussaint wants to merge 4 commits intoaaron/provider-proxy-require-cachefrom
Conversation
- Add body sanitization: normalize UUIDs and random localhost ports in request bodies before computing cache keys (--sanitize-body flag) - Add cache miss manifest: write cache-misses.json with details of every cache miss for debugging (--cache-miss-manifest flag) - Bypass proxy for raw.githubusercontent.com (not a provider API) These changes reduce cache misses when running in read-only-require-hit mode by making cache keys deterministic across test runs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Changing the hash algorithm invalidates all existing cache entries. Default to false so the existing R2 cache remains valid. Enable after repopulating the cache with the new algorithm. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Body sanitization (UUID/port normalization) invalidates the entire existing R2 cache. Defer that to a follow-up with coordinated cache repopulation. This commit keeps only: - Cache miss manifest (--cache-miss-manifest flag) - raw.githubusercontent.com in no_proxy list Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Normalize UUIDs and random localhost ports in request bodies before computing cache keys. This makes cache keys deterministic across test runs where tests embed random values in prompts or image URLs. Enabled by default (--sanitize-body=true). This will invalidate the existing R2 cache — a one-time cache repopulation in write mode is needed after merging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Built on top of #7205. Reduces cache misses when running in
read-only-require-hitmode:--sanitize-bodyflag, on by default). This makes cache keys deterministic across test runs where tests embed random values in prompts.cache-misses.jsonfile with details of every cache miss (--cache-miss-manifestflag). Useful for debugging which tests bypass the cache.raw.githubusercontent.com: Added to theno_proxylist since these are file fetches, not provider API calls.What this fixes
From the failure analysis of #7205:
"...something went wrong: 019d641f-3802...") → fixed by UUID normalization127.0.0.1:<random_port>in image URLs → fixed by port normalizationraw.githubusercontent.com→ fixed by bypassing proxyTest plan
cargo clippypasses forprovider-proxyandtensorzero-coreread-only-require-hitmode show fewer cache misses🤖 Generated with Claude Code