Skip to content

v2.0.3

Choose a tag to compare

@cnighswonger cnighswonger released this 17 Apr 18:41
· 240 commits to main since this release

BUGFIX: cache_control_sticky still exceeded 4-marker limit on CC v2.1.112

v2.0.2 reduced MAX_POSITIONS from 3→2 assuming CC uses exactly 2 cache_control markers (1 system + 1 messages). CC v2.1.112 uses 3 markers in some configurations, so 2 sticky + 3 CC = 5 — still exceeding Anthropic's hard limit of 4.

Fix: Count all existing cache_control markers across the full body (system + messages) before adding sticky markers, and cap the total at 4. No more assumptions about CC's marker budget.

Impact: Caused 400 invalid_request_error in production. Upgrade immediately if running v2.0.1 or v2.0.2 with cache_control_sticky enabled (the default).

npm update claude-code-cache-fix

162 tests passing.