SIGN IN SIGN UP

Anthropic Messages API: own cache_control placement; drop heuristic breakpoints (#315406)

* refactor: enhance cache control logic for tools and system prefixes

* refactor: enhance summarization and cache control handling in agent prompts

* refactor: remove unused countCacheControl function from messagesApi tests

* Add tests for summarization and cache control features

- Introduced a new snapshot test for summarization without cache breakpoints in `agentPrompt.spec.tsx`.
- Added a new test suite for `clearAllCacheControl` in `messagesApi.spec.ts` to validate cache control stripping and limits.
- Created a snapshot for summarization without cache breakpoints in the new snapshot file.

* test: pass enableSummarization in summarization.spec helper

The agentPrompt prop split decoupled enableSummarization from
enableCacheBreakpoints, so summarization.spec.tsx — which only set
enableCacheBreakpoints — fell through to the non-summarized branch
and broke 5 snapshot tests. Default the helper's baseProps to
enableSummarization: true so each test exercises the summarized path
as intended; individual tests can still override via otherProps.
B
Bhavya U committed
a6ba5517833fdf23e31370a12d1903494a3f9041
Parent: 9300eb8
Committed by GitHub <noreply@github.com> on 5/9/2026, 4:31:35 AM