Skip to content

fix(chat): retain correction turn observation across navigation - #8531

Merged
cocolord merged 1 commit into
mainfrom
codex/typed-actions-interrupt-20261111
Nov 10, 2026
Merged

cocolord merged 1 commit into
mainfrom
codex/typed-actions-interrupt-20261111

Conversation

@cocolord

@cocolord cocolord commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

When a running correction is left for Overview and reopened in Chat, history recovery starts competing observers because the correction never registers its stream with the shared Session/Turn owner. Interrupting the run can then settle the recovered row while leaving the original correction pending.

Register correction streams in the existing observer map and release controls only when the finishing callback still owns them. The browser regression navigates away and back before interruption, checks one running subscription, and checks that no pending interrupt control remains. Stored terminal proposal readback remains allowed.

Validation:

  • The same regression fails on the base with 3 running subscriptions and passes on this change with 1.
  • Full typed-actions development coverage and packaged browser journeys pass; packaged conversation-activity passes over real HTTP/SSE with a synthetic executor, including interruption/completion races.
  • Dashboard and Chat builds pass. Conversation-history validation against the real HTTP/ChatStore owner passes.
  • Standard premerge passes on commit 4a332e84a, including bilingual diff and public-boundary checks. Change-quality policy is disabled for this work.

Presentation: no initial viewport layout, navigation, labels or styling changes. The change affects the lifecycle of an existing correction message. Browser acceptance uses synthetic execution; installed-host rollout and the prior CI timeout's precise cause are not claimed by these results.

Scope/refactoring: reuse the existing observer registry and controller identity checks; no additional state owner, API, dependency or permission change.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

@cocolord cocolord left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · GPT-6 · OpenAI · self_reported

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

在 Goal Chat 中给运行发送纠偏、切换视图后再停止的用户会遇到这个问题。同一条运行中的纠偏从 Chat 切到 Overview 再返回时,基线产生三个活动订阅;修复后保持一个订阅,中断回执让原消息结束,并移除待处理中断按钮。重复订阅会让恢复消息与原纠偏消息竞争控制器,造成停止状态误导用户,可能引发重复干预。

用户能够在原会话看见纠偏已中断,并继续输入,不需要再次停止或重建会话。本次不修改模型执行、权限、任务调度、性能预算或跨渠道配置。安装版真实执行器采用、Lark 独立验收及先前 CI 超时的精确根因仍未在本次证明,整体发行整合仍有剩余工作。

改动思路 / Approach

纠偏入口先通过现有 typed action 取得接受回执,再观察它指定的会话和回合。恢复路径本来就按 Session/Turn 查询观察者表;普通输入框登记了自己的观察者,但纠偏入口缺少这一步。保留已有 Session/Turn 观察者表即可满足恢复复用与旧回调不能清除新控制器的不变量,无需增加持久状态或第二套恢复机制。

本次边界是纠偏流在已有前端所有者中的登记和按身份清理,以及原浏览器场景中的导航回归;后端中断与终态回读契约保持不变。登记由真实接受回执触发,值是当前 AbortController,结束时按对象身份释放,属于可推导的瞬态投影。权限与是否接受纠偏仍由原后端决定,恢复读取不会启动另一轮工作。停止被拒绝或回执错配时,原流继续;完成抢先发生时保留最终答案。把超时调长无法消除竞争,而增加终态账本会重复现有会话所有者的责任。

具体改动 / Changes

评审 head:4a332e84ae05b0a6ebb97a8508b1ac6de3181483。两个文件共 +42/-10,其中产品代码 +16/-8,现有回归场景 +26/-2,没有新依赖、公开字段或持久格式。

关键代码讲解

  1. onCorrectRun 在 apply 返回 turn_id 后,以原会话和回合登记当前 controller。finally 只有在观察者表仍指向自己时才删除该项;只有流和活动回合也仍属于自己时,才移除运行控制并将绑定置为 ready。因此旧回调不会误清除后来接管的控制器。
  2. recovery existingObserver lookup 保持原逻辑:找到未中止的同回合观察者便复用并返回。本次让它能找到纠偏入口,未改活动回合来源,也未阻止缺失观察者时的正常恢复。
  3. interruptManagerTurn 保持原回执判断。只有实际 interrupted 且当前回合仍匹配,才中止捕获的当前 controller。修复后这个 controller 属于原纠偏流,其 catch 结束原消息;拒绝、错配与完成竞态仍走原保护分支。

typed-actions 回归 在首次精确会话/回合 events 请求出现后执行视图往返,然后停止。计数依据后端 active_turn_id,仅统计仍在运行的订阅;合法的已完成提案回读也访问 events,但不算活动观察者。测试保留原 10 秒中断文案限制与精确回执验证,没有靠放宽时间通过。

规范来源:docs/architecture/rfcs/intelligent-review-presentation-surfaces-v0.md,spec_revision=d3ac3bd8d69821ae5843b7cef5fdb6dcbc7cae74,§8.8。下列 criterion_id 是对本节既有条款的评审定位标签,未新增规范义务:

  • 8.8-reconnect-replay — implemented:按同一 Session/Turn 复用观察者;同场景基线活动订阅 3、head 为 1。
  • 8.8-stop-readback — implemented:停止绑定当前会话和回合、旧控制不能影响后续回合;typed-actions 与 conversation-activity 覆盖原消息结束、拒绝、错配和完成竞态。
  • 8.8-channel-qualification — out_of_scope:§8.8 明确 Lark 独立验收、视觉一致性不是 App 发布阻塞;本次只修复前端观察者,未声称完成 Lark 验收。

对主干的风险 / Risks

最强反例是现有“不切换视图”的测试可以通过,而恢复路径仍会另外订阅。此次同一最终回归在原产品源码上 FAIL(活动订阅 3,期望 1),head development coverage PASS(81.418 秒),packaged typed-actions PASS(66.423 秒);打包场景的真实前端仍使用确定性合成 action/session 路由,因此不声称真实模型端到端通过。

Dashboard/Chat build、真实 HTTP/ChatStore conversation-history、真实 HTTP/SSE 加合成执行器的 packaged conversation-activity 均 PASS。后者包含拒绝中断、错配回执、完成竞态及恢复继续。该精确 head 的 standard premerge 为 PASS:4 个直接检查和 5 个选定检查,包含双语 diff 与公开边界检查,无失败、警告或手工 hold。独立 loopx check 在本机 registry activation metadata 兼容错误处退出、实际扫描数为零,不能报告成功;同一公开边界已由 premerge 直接扫描。change-quality policy 为 disabled。

远端 CI 尚有排队和运行项(UNVERIFIED),一次 inspect-pr-diff 被取消,后一次已成功;取消原因未确定,不把历史失败重分类。合入 readiness 与本评审结论单独判定。此次原调用者就是运行详情的纠偏操作,机制成本只有已有表中的一个临时条目;没有持久迁移、调度副作用、默认开启扩展或更广的取消权限。普通会话发送、恢复与停止的既有场景保持通过,未发现新增阻塞问题。回滚可直接撤销本提交,历史会话数据不受影响。

我的整体评价 / Verdict

没有 blocking finding,结论为 APPROVE;delivery verdict 为 justified_increment。long_horizon 为 preserved:保留原会话、历史和结果回读,不引入任务或租约状态;user_experience 为 improved:一次纠偏和一次停止即可得到明确终态。基线反证与 head 通过支持这个独立缺陷修复,不等同于全部发行目标完成。

已检查打包前端在桌面和窄屏的中断结果:原消息显示已中断及已结束,输入框可用,没有残留运行控制。桌面为 1440×1000、窄屏为 390×844;检查覆盖长活动名称、既有答案与完成/等待混合状态,窄屏未见横向溢出。截图使用合成执行后端;没有验证安装版真实模型执行或 Lark 展示,也没有改变初始视口布局。

同时复用了相同最终产品代码的默认 Chat 视口截图:关闭详情后,长活动卡片、已完成工作、折叠的其他提议及阻塞项层次可辨,输入框始终可见;答案位于活动区域下方,可由“回到最新消息”抵达。本次不改展开规则或响应式布局,因此未要求新的展开/布局矩阵;结果区桌面与窄屏检查补足中断状态的可见性。

变更复用本地瞬态关系,没有新增共享词汇。已删除候选方案中没有证据需要的活动回合来源修改;现有表加身份检查是足够且可逆的修复。必需局部验证已通过,远端 CI、安装态与先前超时根因的界限保留。若提交、调用路径或后端回执语义变化,需要重新核对证据,不能继承本结论。

English verdict: APPROVE at 4a332e8. No blocking findings; the navigation regression and required local checks pass. Remote CI and installed-executor qualification remain separate.

@cocolord
cocolord merged commit b89a574 into main Nov 10, 2026
13 of 15 checks passed
@cocolord
cocolord deleted the codex/typed-actions-interrupt-20261111 branch November 10, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant