fix: strip cache_control fields from content blocks (#189)

Claude Code CLI sends cache_control on text, thinking, tool_use, and
tool_result blocks for prompt caching. Cloud Code API rejects these
with "Extra inputs are not permitted".

- Add cleanCacheControl() to proactively strip cache_control at pipeline entry
- Add sanitizeTextBlock() and sanitizeToolUseBlock() for defense-in-depth
- Update reorderAssistantContent() to use block sanitizers
- Add test-cache-control.cjs with multi-model test coverage
- Update frontend dashboard tests to match current UI design
- Update strategy tests to match v2.4.0 fallback behavior
- Update CLAUDE.md and README.md with recent features

Inspired by Antigravity-Manager's clean_cache_control_from_messages() pattern.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Badri Narayanan S
2026-01-25 03:27:05 +05:30
parent 6cadaee928
commit 683ca41480
9 changed files with 466 additions and 30 deletions

View File

@@ -35,7 +35,8 @@
"test:oauth": "node tests/test-oauth-no-browser.cjs",
"test:emptyretry": "node tests/test-empty-response-retry.cjs",
"test:sanitizer": "node tests/test-schema-sanitizer.cjs",
"test:strategies": "node tests/test-strategies.cjs"
"test:strategies": "node tests/test-strategies.cjs",
"test:cache-control": "node tests/test-cache-control.cjs"
},
"keywords": [
"claude",