Skip to content

perf(roadmap): a stage return reads the Claude prompt cache - #7931

Merged
dan-petty merged 2 commits into
mainfrom
perf/7922-stage-return-prompt-cache
Nov 30, 2026
Merged

dan-petty merged 2 commits into
mainfrom
perf/7922-stage-return-prompt-cache

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

On a Claude gateway group, each gate return of a stage plan wrote the whole plan request into the Anthropic prompt cache again, because the request, previous and problem were one user message.

A plan run of a Claude model now sends the request as two text parts with a cache break after the part that every run of the item repeats. The model of a Claude group turns the break into cache_control through the pydantic-ai hook for user prompt items. The joined text does not change, so the prompt does not change. Each other model gets one text, as before.

A live test on claude-sonnet-5-5 read 26,895 of 26,932 input tokens from the cache on the second request, with no cache write.

Closes #7922

Change: openspec/changes/archive/2026-11-30-7922-stage-return-prompt-cache/

@dan-petty dan-petty added type/infra Type infra: the build, CI, images or cluster scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 30, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Check results

Head commit: 85e1f015c34a6ea10424be27349e320e5a4dd56a

Check Conclusion Link
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
gitleaks success run
Changed-Test Independence success run
Trivy neutral run
Service Image Tests (shard 3 of 6) success run
Service Image Tests (shard 2 of 6) success run
Service Image Tests (shard 5 of 6) success run
Service Image Tests (shard 4 of 6) success run
Service Image Tests (shard 6 of 6) success run
Service Image Tests (shard 1 of 6) success run
Plan Check skipped run
CodeQL success run
Tests on Main skipped run
Test Job Duration skipped run
Fail-to-Pass Check skipped run
Tests & Coverage (shard 4 of 6) success run
Tests & Coverage (shard 3 of 6) success run
Tests & Coverage (shard 5 of 6) success run
Changed-Test Independence (run 1 of 3) success run
Changed-Test Independence (run 3 of 3) success run
Design Tokens success run
Static Analysis success run
Tests & Coverage (shard 1 of 6) success run
Service Image success run
Changed-Test Independence (run 2 of 3) success run
Tests & Coverage (shard 6 of 6) success run
Tests & Coverage (shard 2 of 6) success run
Runner Image success run
Docs Site Build success run
Service Image Build success run
Semantic PR title success run
Analyze (python) success run
Analyze (actions) success run

Skipped check: Trivy
Skipped check: Plan Check
Skipped check: Tests on Main
Skipped check: Test Job Duration
Skipped check: Fail-to-Pass Check

@dan-petty
dan-petty marked this pull request as ready for review November 30, 2026 20:41
@dan-petty
dan-petty merged commit b4af1d6 into main Nov 30, 2026
36 checks passed
@dan-petty
dan-petty deleted the perf/7922-stage-return-prompt-cache branch November 30, 2026 20:45
dan-petty-release Bot added a commit that referenced this pull request Nov 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.265.0](v0.264.1...v0.265.0)
(2026-11-30)


### Features

* **docs:** check code-span paths in prompt documents
([#7941](#7941))
([68eb592](68eb592))


### Bug Fixes

* **roadmap:** accept requirement names and quoted stage commands
([#7939](#7939))
([3afb7b7](3afb7b7))
* **service:** read a 403 that names a rate limit as one
([#7940](#7940))
([f197986](f197986))
* **service:** redeliver once for the App with a valid JWT
([#7938](#7938))
([c92bfdb](c92bfdb))


### Performance Improvements

* **roadmap:** a stage return reads the Claude prompt cache
([#7931](#7931))
([b4af1d6](b4af1d6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/infra Type infra: the build, CI, images or cluster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(roadmap): a stage return reads the Claude prompt cache

1 participant