mirror of
https://github.com/browser-use/browser-use.git
synced 2026-09-14 19:59:47 +08:00
3787380829
Previously, cache_control was applied to every content block and tool call in a message, which could exceed Anthropic's limit of 4 cache breakpoints per request. This fix ensures cache_control is only applied to the last block in each message type: - Last text block in UserMessage/AssistantMessage content - Last tool_use block when AssistantMessage has tool calls - Only the last overall block when AssistantMessage has both content and tools This prevents exceeding the cache breakpoint limit while maintaining correct caching behavior.
11 KiB
11 KiB