mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-03-21 16:40:22 +00:00
Problem: - PR #162 fixed empty string content but missed array content with tool_use - OpenCode's compaction requests send assistant messages with content as array - When content array contains only tool_use (no text), content becomes empty - This causes 'Improperly formed request' errors from Kiro API Example of problematic message format: { "role": "assistant", "content": [ {"type": "tool_use", "id": "...", "name": "todowrite", "input": {...}} ] } Solution: - Extract tool_use from content array (Anthropic/OpenCode format) - This is in addition to existing tool_calls handling (OpenAI format) - The empty content fallback from PR #162 will then work correctly Fixes compaction failures that persisted after PR #162 merge.