Treat a stream that ends without [DONE] as an error
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 85/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
从 packages/widget/src/api/client.ts 的读取循环及其当前 { done: true } 结果开始,然后查看 packages/widget/tests/api/client.test.ts 和 tests/helpers/stream.ts 中的 helper mockChatStream。为以 [DONE] 结尾和不以 [DONE] 结尾的流添加测试覆盖;done 看起来表示已完成的情况仍然成功,未完成的流会返回 { error: 'network' },超时处理保持正常。为 @chatcops/widget 添加所请求的 patch changeset。
由索引模型根据 Issue 内容生成。
描述
All three server adapters end a reply with data: [DONE]. The widget's client treats the end of the stream as success either way: after the read loop it yields { done: true } (packages/widget/src/api/client.ts, lines 129 and 130). When a proxy or the server cuts the connection mid-reply, the visitor gets a half answer with no error and no Retry button.
What to do
- If the stream ends without a
[DONE]line, yield{ error: 'network' }instead of{ done: true }. - A
[DONE]that arrives keeps working as today, and so does the timeout handling.
Acceptance criteria
- Tests in
packages/widget/tests/api/client.test.ts(themockChatStreamhelper intests/helpers/stream.tsbuilds the fake stream): ending with[DONE]givesdone, ending without it giveserror: 'network' - Changeset for
@chatcops/widget(patch) -
pnpm -r build,pnpm testandpnpm -r typecheckpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- 主要语言
- TypeScript
- 星标
- 13
- 派生
- 7
- 平均合并
- 3 小时 41 分钟
- 30 天内合并 PR
- 155
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codercops/chatcops 的其他 Issue
-
Document the pre-chat form可能已有人在做 @masyarakatai 于 6 天前认领。 未关闭documentation good first issue hacktoberfest widget
难度 2/5 1-3 小时 新手友好度 88/100
codercops/chatcops#70 · 5 条评论 ·
维护者通常 1 天内回复
-
docs: update the providers page for openai-compatible, registerProvider and provider imports可能已有人在做 @prakashNalla 于 1 天前认领。 未关闭documentation good first issue hacktoberfest website
难度 3/5 1-2 天 新手友好度 76/100
codercops/chatcops#291 · 1 条评论 ·
维护者通常 1 天内回复
-
docs: add a protocol reference page for custom clients可能已有人在做 @kachamsiddarth 于 1 天前认领。 未关闭documentation good first issue hacktoberfest website
codercops/chatcops#286 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Create @chatcops/store-cloudflare (D1, KV and a Durable Object counter)可能已有人在做 @bhushan4work 于 1 天前认领。 未关闭enhancement hacktoberfest help wanted server
难度 5/5 一周以上 新手友好度 25/100
codercops/chatcops#249 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Create @chatcops/store-sqlite, a store for single-server setups可能已有人在做 @srikar-naidu 于 1 天前认领。 未关闭enhancement hacktoberfest help wanted server
难度 5/5 一周以上 新手友好度 35/100
codercops/chatcops#247 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 codercops/chatcops 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
cursor/community-plugins#465 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
vetro-protocol/vetro-monorepo#978 ·
维护者通常 1 天内回复
-
ai-generated bug category:security effort:s priority:p3
难度 2/5 1-3 小时 新手友好度 67/100
LanternOps/breeze#9697 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
maniator/verticopolis#1303 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
components-web-app/docs#297 ·