- [Cross-Protocol SSE Byte-Level Line Buffering & Multibyte Splitting Defense] Eliminate Deserialization Failures & Stream Interruptions on CJK/Cyrillic/Emoji/Non-ASCII TCP Chunk Fragmentation (Fixes #3593):
- SSE Collectors Upgraded with
BytesMutLine Buffering: Refactoredclaude/collector.rs,openai/collector.rs, andgemini/collector.rs. Completely eliminated naiveString::from_utf8_lossy(&chunk).lines()chunk-by-chunk splitting in favor ofBytesMutaccumulating byte streams with strict newline (\n) slicing. - Multilingual UTF-8 Boundary Splitting Protected: When CJK (3-byte), Cyrillic/Arabic (2-byte), Emoji/special symbols (4-byte), or oversized tool outputs are fragmented across TCP MTU boundaries, legacy chunk slicing produced corrupt
\u{FFFD}replacement bytes that broke JSON parsing; the new architecture guarantees UTF-8 parsing only takes place on fully assembled lines. - Streaming Protocol Transcoder Hardening & Residual Flushing: Hardened SSE line processing in
gemini.rs,claude/mod.rs, andopenai/streaming.rswithString::from_utf8_lossyagainst upstream malformed bytes, and reliably flush unconsumed buffer tails on stream termination. - Cross-Chunk Cyrillic Splitting Regression Test: Introduced a unit test in
claude/collector.rs(test_collect_multibyte_chunk_split_with_cyrillic) explicitly slicing Cyrillic words mid-character across arbitrary chunks, verifying 100% lossless assembly. (Thanks to @Hubitski)
- SSE Collectors Upgraded with
- [Google AI Pro Family Sharing Entitlement Support] Access Latest Claude Models via Family Sharing:
- Family Plan Member Account Recognition: Verified and supported Google AI Pro quota sharing via Google One Family Sharing. Family member accounts added to the gateway token pool now inherit model capabilities and can seamlessly invoke the latest Claude models.
- [三大协议 SSE 字节级行缓冲加固与多字节防撕裂] 彻底解决中文/俄语/Emoji 等非 ASCII 多字节字符与长工具输出跨 TCP Chunk 拆包导致反序列化崩溃与断流 (Fixes #3593):
- 流收集器全量升级
BytesMut字节级行缓冲区: 重构claude/collector.rs、openai/collector.rs与gemini/collector.rs。彻底废除旧版直接在单个原始数据块上调用String::from_utf8_lossy(&chunk).lines()的朴素切片逻辑,全面引入BytesMut字节流累积与\n定位切割。 - 杜绝多语言 UTF-8 跨 Chunk 撕裂: 无论是中日韩(3字节)、俄语/阿拉伯语(2字节)、Emoji/特殊符号(4字节)还是超长工具调用结果,当数据恰好落在 TCP MTU 拆包边界时,旧版切片会在边界产生无效替换符
\u{FFFD}破坏 JSON 语法;新版保证必须在接收到完整换行后才进行 UTF-8 校验与分发。 - 流式转译层严密容错与残余清空: 加固
gemini.rs、claude/mod.rs与openai/streaming.rs的行解析逻辑,改用String::from_utf8_lossy防范上游偶发非 UTF-8 字节,并在流正常终止时完整清空末尾缓冲区残余行,杜绝末行丢失。 - 新增跨 Chunk 切割单元测试: 在
claude/collector.rs增加刻意在多字节字符中间进行切片的严苛单元测试(test_collect_multibyte_chunk_split_with_cyrillic),确保任意碎片化 TCP 流均可 100% 无损组装。 (Thanks to @Hubitski)
- 流收集器全量升级
- [Google AI Pro 家庭共享权益互通说明与支持] 支持通过家庭组共享获取最新 Claude 模式:
- 家庭共享账号权限识别: 确认并支持 Google AI Pro 账号通过 Google One 家庭组(Family Sharing)共享获得高级模型配额,家庭成员账号加入网关号池后亦可顺畅识别并调用最新的 Claude 模型模式。
Full Changelog: v4.9.2-beta.7...v4.9.2-beta.8