[BUG] Gemini Stream Error: Incomplete JSON segment at the end

未关闭
#2,682 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
22/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
活跃
技术栈
typescript
领域
api, backend

调研方向

The payload names only the error text 'Incomplete JSON segment at the end' from the Gemini context stream path. Start by searching the repository for that message and for the Gemini stream handling around it, then reproduce with a long multi-step task. The payload gives no reproduction that reliably triggers the error and no expected behaviour beyond 'normal result', so a contributor would first need to define what a fix must guarantee.

由索引模型根据 Issue 内容生成。

描述

bug
Problem (one or two sentences)

A Gemini context stream request sometimes fails and Zoo Code shows this error: Gemini generate context stream error: Incomplete JSON segment at the end.

Context (who is affected and when)

I use the Gemini provider with a direct Google API key and the gemini-flash-lite-latest model. The error occurs at random, but it occurs more often during long tasks. Also common in gemini-flash-latest and gemini-4-hydrogen. Don't know about the other Gemini models.

Reproduction steps
  1. Zoo Code 3.98.2 in VSCodium 1.143.17232 on Windows 10 LTSC.
  2. Do a request that will result in it needing to do some work.
  3. Many errors before working, at random.
Expected result

Normal result

Actual result

Incomplete JSON segment at the end

Variations tried (optional)

No response

App Version

3.98.2

API Provider (optional)

Google Gemini

Model Used (optional)

gemini-flash-lite-latest

Zoo Code Task Links (optional)

No response

Relevant logs or errors (optional)

主要语言
TypeScript
星标
2k
派生
301
平均合并
3 天 14 小时
30 天内合并 PR
103

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Zoo-Code-Org/Zoo-Code 的其他 Issue

查看 Zoo-Code-Org/Zoo-Code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。