mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
b0802a5c32
The issue was that cache control persisted across turns in conversation history, causing accumulation beyond Anthropic's 4-block limit. Changes: - Count existing cache blocks in message history before adding new ones - Only add new cache blocks up to the 4-block limit - Remove tool caching (was adding 1 block per turn) - Skip messages that already have cache control set Tested with 5 sequential messages - no errors, proper cache metrics.