Skip to content

Let a benchmark turn off prompt and gateway caching for repeatable turns (a question) #754

Closed

Description

@webchang

Question

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

  1. added a commit that references this issue on Nov 17, 2026
    70823fe
  2. added this to the v0.11.0 milestone on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions