- Added support for processing `signature-only` chunks without opening empty text blocks.
- Refactored chunk handling logic to include `signature_delta` events for improved fidelity.
- Unified logic for emitting final message states, including `message_delta` and `message_stop`, to ensure consistent behavior across different scenarios.
- Enhanced caching mechanism for thought signatures.
- Introduced support for processing `encrypted_content` reasoning signatures in request and response translations.
- Updated `ConvertOpenAIResponsesRequestToClaude` and `ConvertClaudeResponseToOpenAIResponses` to handle reasoning signatures and summaries.
- Added tests to validate signature preservation and correct reasoning content transformation in both streaming and non-streaming scenarios.
- Refactored processing logic to ensure reasoning content flushing before user messages.
- Updated `ConvertClaudeRequestToGemini` to ignore empty `text` entries during processing.
- Added unit tests to ensure empty `text` parts are skipped correctly.
Closes: #3485
- Updated all references from v6 to v7 for `github.com/router-for-me/CLIProxyAPI`.
- Ensured consistency in imports within core libraries, tests, and integration tests.
- Added missing tests for new features in Redis Protocol integration.
- Introduced `claudeUsageTokens` struct for detailed token usage tracking.
- Replaced `calculateClaudeUsageTokens` with `Merge` and `OpenAIUsage` methods for better modularity.
- Enhanced integration of usage tokens into response processing, enabling more accurate reporting of token details.
Fixed: #2419
- Added `setToolCallOutputContent` to process various content types, including arrays and fallback cases.
- Implemented robust handling for specific tool output types like text, image URLs, and files, ensuring proper serialization.
- Improved fallback logic to handle unexpected or missing data.
Fixed: #2313Closes: #2349
- Introduced a new test file for validating the conversion of OpenAI responses to chat completions.
- Implemented tests to ensure correct merging of consecutive function calls and proper handling of interrupted function calls.
- Enhanced the main conversion function to buffer consecutive function calls and emit them as a single assistant message.
- Implemented `appendReasoningContent` to support processing of `thinking` signature and text as reasoning input.
- Added test cases to validate reasoning content conversion with and without text.
- Introduced `LastImageHashByItemID` in Codex-GPT and `LastImageHashByID` in Codex-Gemini for deduplication of generated images.
- Added support for handling `partial_image` and `image_generation_call` types, with inline data embedding for Gemini and URL payload conversion for GPT.
- Extended unit tests to verify image handling in both streaming and non-streaming modes.
The x-anthropic-billing-header block in the Claude system array is
client-internal metadata and should not be forwarded to the Gemini
upstream as part of systemInstruction.parts.
Proxy-generated thinking blocks may carry hex hashes or other non-Claude
signatures (e.g. "d5cb9cd0823142109f451861") from Gemini responses. These
are now discarded alongside empty-signature blocks during the strip phase,
before validation runs. Valid Claude signatures always start with 'E' or 'R'
(after stripping any cache prefix).
Thinking blocks with empty signatures come from proxy-generated
responses (Antigravity/Gemini routed as Claude). These should be
silently dropped from the request payload before forwarding, not
rejected with 400. Fixes 10 "missing thinking signature" errors.
Antigravity wraps empty thinking text into a prompt-caching-scope
object that omits the required inner "thinking" field, causing 400
"messages.N.content.0.thinking.thinking: Field required" when Claude
Max requests are routed through Antigravity in bypass mode.
Raise the local bypass-signature ceiling so long Claude thinking signatures are not rejected before request translation, and keep the oversized-signature test cheap to execute.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
delegate schema sanitization to util.CleanJSONSchemaForGemini and drop the top-level eager_input_streaming key to prevent validation errors when sending claude tools to the gemini api