You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let a benchmark turn off prompt and gateway caching for repeatable turns (a question) #754
Would upstream want a way to turn caching off for a turn, on both sides? For repeatable benchmark turns we needed two switches:
SH_PROMPT_CACHE=off: a harness extension strips Anthropic cache_control markers from the prompt.
SH_GATEWAY_CACHE=off: sends cache.no-cache on every model request, so a caching gateway doesn't answer from its own response cache.
Both are opt-in: unset, today's behavior (caching on) is unchanged. Together they're about 240 lines, mostly tests: harness/src/prompt-cache-extension.ts, two lines in run-turn.ts, and a test file.
Why we needed them: when the same prompts are re-run to compare configurations, cached prefixes and cached responses change the token accounting and the timings between runs. In our runs, turning caching on moved tokens into the cache-read class without a latency benefit we could demonstrate.
We'll send a PR only if a maintainer wants this. Otherwise this issue records the need.
Activity
feat(harness): opt-in SH_PROMPT_CACHE / SH_GATEWAY_CACHE switches to …