Files
sub2api/backend/internal/service
chengjingtaoandClaude Opus 5.5 bff0f1554f fix(antigravity): skip SSE comment keepalives for js-genai < 1.32 (Gemini CLI)
js-genai before 1.32.0 parses the stream with
/^\s*data: (.*)(?:\n\n|\r\r|\r\n\r\n)/ anchored at the head of its
buffer, so the first ":\n\n" keepalive blocks every later event and the
stream fails with "Incomplete JSON segment at the end". Gemini CLI (up to
0.70.0) pins js-genai 1.30.0 and sends it in X-Goog-Api-Client
("google-genai-sdk/1.30.0 gl-node/..."), so long native Gemini streams
fail for every Gemini CLI user (#8941). js-genai 1.32.0 (c9c1359) splits
the buffer at each delimiter and drops non-data events, so newer Node
clients keep the keepalive.

Treat gl-node clients with google-genai-sdk < 1.32 like go-genai and
python-genai. The old "js-genai tolerates comments" test case used 1.9.0,
which also stalls; it now expects the skip.

Fixes #8941

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 12:23:25 +00:00
..
2026-10-09 10:11:06 +08:00
…