Repository navigation
fix(chat): keep the steward's active Turn connected across views - #8662
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit a32597f) Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max
本次评审对应提交 cb648901e1b21a2f9e7211eb2b28f33be0d31414。
没有阻塞发现。
动机 / Motivation
用户在管家仍回复时切去总览看进展,再回到对话,按 Command+Enter 补充当前指令。旧版在切换视图时拆掉已恢复的事件流。恢复请求若尚未返回,快捷键会走普通发送;独立测试的真实服务因原 Turn 仍忙而拒绝。新提交保留原事件流和调整入口。存储不可写时,页面提示原因并保留草稿,请求没有发出;恢复后,快捷键只向原 Turn 追加一次。已验证源码构建的桌面与 390 像素浏览器界面,使用真实本地 Chat 服务与模拟执行器;已安装桌面 App、线上执行器及托管 CI 未验证。
改动思路 / Approach
让恢复 effect 依赖会话是否允许恢复。管家总览和对话使用同一条件;Goal 仍须进入对话才恢复。保留现有 Session、Turn、浏览器重试状态与 API;只改变管家同会话内的视图切换和对应回归;末次更新另修一个已导入 pytest fixture 的误报。 浏览器不用维护第二份活动状态;只改变原恢复 effect 的触发条件。
具体改动 / Changes
关键代码讲解
在 恢复条件 将原视图替换成可恢复状态,cleanup 依赖 仍包括真实会话和连接。追加入口 继续向原 Session/Turn 派发并回读。
按 会话协议(docs/integrations/session-runtime-control-plane-adapter.md @ ce69003c73378fdb067a6b86e7b60feb50cb1b77)核对 ACTIVE_TURN_STEERING、STORAGE_REFUSAL、SCOPED_SESSION_ENTRY。基线在相同延迟下确实发出一次普通请求。真实服务拒绝,所以没有观察到额外原生 Turn,也没有丢失草稿。新提交在同一故障下的恢复、流、普通发送及追加请求增量均为零。解除故障后,Command+Enter 只向原 Turn 追加一次,历史里该指令在原 Turn 下出现一次。
对主干的风险 / Risks
真正切到 Goal 时仍须受原入口限制。两版的 Goal 概览都不创建或恢复会话,已有活动 Turn 在显式返回 Chat 时才重新订阅。普通发送的队列入口保持原行为。
语义与 CI 对齐
两版浏览器复验用实际编译的前端、隔离本地 Chat 服务和模拟执行器。观察原始提交 837977b:新头只在原 Lark 测试为已导入的 fixture 参数补一条 F811 注释,Chat 源码、服务、浏览器回归和重新构建的入口字节均一致。相同的 Lark 测试在 base 和新头各通过;base 的同命令唯一 Ruff 误报在新头消失。17 项前端测试和当前 quick premerge 通过。未查询托管 CI。
我的整体评价 / Verdict
批准这个 head。修复了同一管家会话里快捷键误走普通发送的窗口,并保留现有 Goal 恢复路径。实际桌面与 390 像素故障截图中,回复和原调整按钮仍在对话主列,提示紧邻同一个输入框;窄屏可见提示、草稿及发送按钮。总览保留对话活动提示,不浮出会话;正常窄屏另核对了 PR 所附同提交图。未验证安装版、触屏外接键盘和真实执行器。此次没有改版式或工作详情折叠。
English verdict: APPROVE. Approve this head. View changes preserve the active Steward observer; a storage failure blocks dispatch and recovery steers the original Turn.
Goal and delivered outcome
A correction typed in the steward conversation could go through the ordinary send path after switching through Overview. The recovery effect treated the view change as a reason to retire the active Turn observer and reopen the same Session. A delayed resume left the composer without the running Turn it had already observed.
The steward's Overview and Chat share one recovery lifetime. The current Session and its event stream stay connected when switching views. The existing Goal Chat entry rule still controls recovery for Goal conversations.
Related to the packaged browser failure reported on #8266. Target base is
main.Author declaration
conversation-activityscenario switches views during an active Turn and verifies the same stream stays connected.conversation-startup,chat-recoveryandcomposer-session-admissionpass through the existing routes.Scope and continuation
This change uses the existing conversation recovery effect and keeps its lifetime tied to admission and conversation identity. It also removes redundant resume requests and stream reopenings when switching between steward views. The frontend keeps the existing Session/Turn API, steering storage, and capability checks.
The required Linux workflow initially stopped at an existing Ruff fixture error on main. This branch includes the existing one-line correction from #8657 as a separate signed commit so the packaged browser checks can run. The fixture still uses the same Pytest input. Initial static job
Validation
Current revision
cb648901e1b21a2f9e7211eb2b28f33be0d31414passed the full Ruff command, repository invariants, the affected Lark fixture and the packaged conversation activity regression on macOS. The other browser scenarios and the attached screenshots come from837977ba9f, which has identical Chat sources and a bundle verified against the current checkout. Required remote CI and independent review are pending.ce69003c73. The corrected bundle retained the draft, showed the storage error, reused the original stream, and sent zero steering or new-Turn requests in the blocked step.conversation-activity,conversation-startup,chat-recoveryandcomposer-session-admissionusing the compiled Chat bundle.npm run build:chatincludes TypeScript checking. Both composer keyboard unit cases passed. The RFC diff check reported no changed pair.Frontend and visual evidence
Packaged Chat with a synthetic running Turn and storage failure. The same first viewport and composer are used throughout. The existing delivery error is visible beside the preserved draft. The narrow viewport shows the existing composer and running Turn controls.
Before · desktop · main ce69003
The correction appears as a new chat message and the input clears.
After · desktop · 837977b
After · narrow viewport · 837977b
Type of change
LoopX area
Shared-authority RFC fixture impact
N/A. Session/Turn authority, persisted state and API schemas are unchanged.
Boundary checklist