Repository navigation
fix(worker): adopt 模式下跳过畸形 CoT text 条目,不再中断活动流 - #3742
Merged
deepcoldy merged 1 commit intoNov 23, 2026
Merged
Conversation
adopt 会话原样保留 CoT 条目,遇到 text 不是字符串的条目时 cotEntryChars 抛 TypeError,本次 transcript drain 的后续活动条目全部丢失。adopt 路径改为 和非 adopt 路径一样丢弃这类条目,其余条目(含 sentinel 原文)照旧保留。 Fixes deepcoldy#3669 Co-Authored-By: Claude Opus 5.5 <[email protected]>
yintamaa
requested review from
47seek,
LucasIcarus,
deepcoldy,
xiaoxueSunn and
xiongz-c
as code owners
November 23, 2026 13:25
deepcoldy
reviewed
Nov 23, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
PR #3742 复审|head b1d3824d|结论:代码层面可合
- 阻断发现:无。未发现 P1 / P2 / 合前必修 P3,也未发现首审结论需要翻转的依据。
- 审查对象:远端 head 确认为
b1d3824d43ec07724c4fe0faa1d1d01fb9d436bf;本地 rebase 提交9914e9b2c基于最新origin/master(8157a3717),两者默认git patch-id均为6a5d6f3bc8778a826700cd3a05cace8fb08ed5a0,git diff --check通过。 - 修复正确性:
src/worker.ts:10525仅在 adopt 分支丢弃kind === 'text'且text非字符串的条目,并在src/worker.ts:10549-10552的字符统计前完成过滤;合法条目的顺序和内容不变,包括 adopt 模式必须原样保留的 sentinel。非 adopt 的 sentinel 剥除路径未改。 - 回归用例有效:
test/worker-cot-malformed-entry.test.ts:44-47通过 worker function harness 执行真实函数,同时断言「不抛错」和thinkingEntries与完整tail相等,既覆盖后续条目不丢,也钉住 sentinel 不被误剥。 - 影响面:变化只发生在 adopt 会话收到畸形 text 条目时;其它 CLI 的合法 CoT 条目、非 adopt 会话、工具调用/结果及持久状态语义均未改变。
- 首审非阻断项:
cotEntryChars对其它 kind 的畸形字段仍是既有、两条路径对称的通用硬化缺口,不是本 PR 引入或扩大的回归;可另行整体加固,不拦本次合入。
本次实际验证
bun run build:通过(含 typecheck、dashboard bundle 与 dist 审计)。bun run test -- test/worker-cot-malformed-entry.test.ts test/background-wait-card.test.ts test/cli-progress-notice.test.ts test/dsh-cot.test.ts test/antigravity-runtime.test.ts test/worker-kimi-activity-wiring.test.ts test/worker-codex-app-process-attestation.test.ts:7 个文件、215 个用例全部通过。- 未另跑完整 unit / e2e 或飞书 live;该修复无需改动持久状态或部署形态。
CI
截至本复审发布时,Sandbox network boundary 已通过,CI 的 build / test / bun-test / binary 各项仍在 queued 或运行中;最终合并仍以这些检查全绿为前提。
Owner
|
感谢修复,PR 已 squash 合入 master,#3669 随之关闭。 评审中确认:adopt 分支新增的过滤只丢弃 一个非阻断的后续建议(不影响本 PR 合入): 以上为自动评审流程的记录,最终以维护者审阅为准。 |
deepcoldy
pushed a commit
that referenced
this pull request
Nov 23, 2026
…ld-composer 同步 #3739 合入后的最新 master(f16cdcb3ad,含 #3713/#3715/#3723/#3742/#3744)。 git 自动合并零冲突;名义交集 src/worker.ts 与 src/i18n/{zh,en}.ts 上双方改动位于 不同区域,已逐项核对本 PR 的改名回执/reattach 恢复逻辑与 master 侧改动 (#3742 畸形 CoT 跳过等)均在合并树中。 验证:tsc --noEmit、bun run build 通过;8 个定向测试文件 251 例全绿 (含两个新测试文件与 worker-cot-malformed-entry)。 Co-Authored-By: Claude Fable 5 <[email protected]>
|
🚀 Released in v3.59.30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么、为什么
adopt 模式下,
observeCotEntries会原样保留 CoT 条目。遇到text不是字符串的 text 条目时,cotEntryChars执行e.text.length会抛 TypeError,本次 transcript drain 后面的活动条目全部丢失。现在 adopt 路径和非 adopt 路径一样,丢弃这类畸形条目。其余条目(包括 sentinel 原文)照旧原样保留,adopt 模式「不剥 sentinel」的语义不变。
影响面
只改了
src/worker.ts里observeCotEntries的 adopt 分支。非 adopt 路径、cotEntryWithoutSentinel以及各 CLI 的观测函数都没动。验证
226fe48ac)上确认它失败:TypeError: Cannot read properties of undefined (reading 'length')bun run test -- test/worker-cot-malformed-entry.test.ts test/background-wait-card.test.ts test/cli-progress-notice.test.ts test/dsh-cot.test.ts:4 个文件,149 个用例全部通过bun run build(含 typecheck 和 dist 审计)通过Fixes #3669
🤖 Generated with Claude Code
)