Replies: 3 comments
|
确认并致谢:这条根因分析是对的,我们独立复现了 / Confirmed — and thank you: this root-cause analysis is correct, and we reproduced it independently 你 9/8 给出的定位,我们这边逐条核对成立,并且独立复现了整条链:
English: Your 9/8 localization checks out line by line on our side, and we reproduced the whole chain independently. Two source-level additions: WebKit's 我们把它做成了可安装的补丁 / We turned it into an installable patch(MIT):
English: Coverage stated honestly: the two client-side artifacts are patched; the 6 further latent copies upstream are not covered because they run on host Node/V8 where the predicate holds (marked "latent" by (顺带一句:这类"精确字符串比对引擎输出"的判据,我们建议上游改成 English: One aside: for predicates that compare engine output exactly, we would suggest upstream switch to 本评论由 DSH agent 整理、经人工复核后提交 / Written by a DSH agent, reviewed by a human before posting. |
|
更正一句(我们昨天评论末尾那条建议)/ One correction to our previous comment @neverth 我们昨天在这条评论末尾写了「建议上游改用
正确的说法是:保留 English: @neverth — one correction to the remark at the end of our comment yesterday: we suggested upstream "switch to 本评论由 DSH agent 整理、经人工复核后提交 / Written by a DSH agent, reviewed by a human before posting. |
|
补充两点 Firefox/SpiderMonkey 侧的增量信息(0.1.7-rc.2 上独立定位到同一处后看到此帖,结论与此楼一致): 1. Firefox 同样命中,实测格式串:
即 Firefox 与 Safari 全中、Chromium 必然免疫——也闭环了 #7677 的 Firefox 症状报告。 2. 触发条件可精确为:follow 快照窗口内存在未结算 attempt。in-flight 流携带 本地在安装包上做了验证性补丁:对该比较做空白归一化(保留 |
Uh oh!
There was an error while loading. Please reload this page.
现象
在 iOS Safari 和 macOS Safari 上,会话正在流式输出时显示正常,但回答结束后再打开这个会话就渲染不出来,刷新也没用。Chrome 完全正常。
根因
packages/util/values/src/index.ts的hasIntrinsicConstructor用精确字符串比较来判断一个构造器是不是原生内建:V8(Chrome / Node)输出的正是这个单行格式,但 JavaScriptCore(Safari)输出的是带换行和缩进的:
两种写法都符合 ECMAScript 的 NativeFunction 语法 —— 该语法固定了
function、名字、参数列表和[native code]这些 token,但把空白的排布留给引擎自行实现。因此把某一种排版写死,等于假定了 V8。后果是在 Safari 上每一个普通对象都过不了「内部原型」检查,连锁反应:
流式输出走的是另一条路径,不回放持久化的 chunk,所以只有「已完成的会话」才复现 —— 这也解释了为什么边输出边看是好的。
复现步骤
Assistant stream raw chunk must be a lossless JSON object。不用真机也能在 Node 里复现,只要把 JavaScriptCore 的排版模拟出来:
引入版本
由
f99b06eaed(feat(session)!: embed assistant streams in format v2) 引入,该 commit 已在当前 master 中。建议的修复
改为按 NativeFunction 语法匹配,而不是钉死某一种排版 —— 语法固定 token,空白交给引擎:
安全性没有放松:函数体必须恰好是
[native code],所以伪造的toString依然会被拒。以下这些都仍然判为 false:function Object() { return "[native code]" }function Object() { /* [native code] */ }function Object() { doEvil(); [native code] }环境
0.1.3-alpha.2(masterb0a7d2ce3b)All reactions