mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-26 01:45:56 +03:00
[GH-ISSUE #157] Incompatible Gemini Stream Format: 'thoughtSignature' merged into text part breaks strict parsers (LiteLLM) #121
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AIClient-2-API-justlovemaki#121
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @themw123 on GitHub (Jan 3, 2026).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/157
Describe the bug
When using the gemini-cli-oauth endpoint with streaming enabled (streamGenerateContent), the API returns a non-standard JSON structure for parts.
Specifically, thoughtSignature is merged into the same object as text. Strict clients (like LiteLLM using the native gemini provider) fail to parse this and return empty content because they expect the official Google API structure.
Current Behavior:
The parts array combines metadata and text:
Expected Behavior (Official Gemini API):
Text parts should be clean, or metadata should be handled separately/according to protobuf specs:
Impact
It is currently impossible to use this proxy with LiteLLM's native gemini provider (used by tools like Claude Code), as it results in empty responses.
@themw123 commented on GitHub (Jan 3, 2026):
I just noticed that this isn't really the cause. It only adds the thoughtSignature at the very end. The problem is more likely due to the use of SSE; the standard gemini API uses Chunked Transfer Encoding instead of SSE
@justlovemaki commented on GitHub (Jan 6, 2026):
Try reporting the issue of being unable to parse SSE to LiteLLM.