Replies: 3 comments 1 reply
|
这 bug 挺阴的——截断在 UTF-16 代理对中间,emoji 直接被劈成两半,序列化层又不清理孤立代理项,会话就永久 400 了。和之前 unknown tool 那个(SSE 分块覆盖工具名)算是一类:都是"流式/截断的边界处理"问题,rc 期这种边界 bug 特别多。 暂时没太好的绕法(会话已经 400 的话只能开新会话),不过这类边界问题我们 FAQ 里汇总了一些同族案例和排查思路,可以参考:https://github.com/Electricitysheep/dsh-handbook/blob/main/docs/faq.md |
|
定位准确,我对着 master 源码核实了: 机制补充:
如果你能提供截断发生处的代码路径(哪个工具/哪段输出),我可以帮忙定位具体的截断点在哪里——这决定修复该放在哪个层。 |
|
I reproduced this issue on the current Patch commit: duduking19@213de28 Branch: https://github.com/duduking19/deepseek-harness/tree/codex/fix-deepseek-malformed-utf16 Root causeJavaScript strings can retain a lone UTF-16 surrogate when code-unit truncation splits an astral code point such as an emoji. FixThe patch calls Joining first is important: it preserves a valid surrogate pair whose two halves happen to occupy adjacent blocks, while isolated high or low surrogates become U+FFFD. The repair occurs only in the DeepSeek wire representation, so existing session logs become sendable without rewriting durable events or changing the session format. Producer-side code-point-aware truncation can still be added independently. Verification
The patch also updates the bilingual package README and includes the required bilingual Agent Note. Since the repository currently does not accept external PRs, I am sharing the validated commit here for maintainers to incorporate if appropriate. 中文附注我已在当前 补丁提交:duduking19@213de28 分支:https://github.com/duduking19/deepseek-harness/tree/codex/fix-deepseek-malformed-utf16 根因JavaScript 字符串按 UTF-16 代码单元截断时,可能把 emoji 等辅助平面码点从中拆开并留下孤立代理项。 修复补丁先拼接相邻文本块,再调用 验证
补丁同时更新了中英文包文档,并包含仓库要求的双语 Agent Note。由于仓库目前不接受外部 PR,现将已验证的提交附在讨论中,供维护者评估和吸收。 |
Uh oh!
There was an error while loading. Please reload this page.
工具输出截断时没有按 UTF-16 代理对边界切割,也没有在序列化前清洗孤立代理项(llm-deepseek/src/serialize.ts 的 flattenText 原样透传)。任何会话只要遇到截断在 emoji 中间的工具结果,就会永久 400 无法继续。
All reactions