Repository navigation
fix(chat): qualify unfinished work after a delivered result review - #8276
loopx-agent wants to merge 1 commit into
Conversation
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 family, OpenAI, self_reported
Reviewed head 2d0906d9a73ed03f77b4b940b6b76f7290fdfe1c
动机
飞书项目助手的用户会遇到这一问题。原请求已产生部分结果,随后只读复核也已送达,剩余步骤仍欠结果。 原路径会在复核结束后退出续办候选。新路径允许原 worker 在取得当前原生线程的完整效果证据后,沿原请求继续剩余步骤。 隔离用例中,原会话保留前两条答复,剩余产物只写入一次,新结果由同一飞书来源独立回传并读回。
交付范围是带结构化未完声明的私有项目会话及其同源回传。跨执行器、外部授权和其他请求类型沿各自合同处理。 线上原会话仍需要合并采用后取得新鲜的活跃 owner 和效果清单,并实际读回原消息补回。
改动思路
资格由 Core 复用原 work-1 决策,原生 owner 核验实际效果,飞书原 worker 复用队列和独立投递阶段。 本 PR 只交付已送达的项目结果复核到一次有证据的续办,以及续办失败后的待办可见性。
用现有工作预留保存两个身份。复核 Turn 用于定位已送达的前一阶段,原业务 Turn 用于读回原生效果。这样恢复时可以认回同一个已提交队列项,派发前也能复核原业务证据。退出、撤权和较新的同文输入分别由原生效果、绑定和当前会话历史判定。
具体改动
planContextRecovery 从原请求的复核记录确认原 Turn、当前绑定和已送达的复核正文。后续交给既有 planUnfinishedWork,复用 work-1 和当前队列。候选状态只安排核验,真正入队仍须取得原生 owner 的稳定库存与新鲜飞书来源。Python 保留原阶段和回执,派发前重新检查源授权、Stop、更新输入与清单。入队后失去原生 owner 会通过现有 host gate 停止。失败、gate、未完或尚未核验送达的续办继续显示为待办,终态读回后关闭对应待办。
按 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md 的基线 3e3e3f841fb46c84c59fd31c94c88c15719a4085 核对 same-source-delivery 和 live-effects-and-stop。 installed-original-return 留待实际采用后验收。
对主干的风险
主要风险是把已送达的只读复核当成效果证明,造成重复写入。已确认原生库存检查覆盖原工作及后续 Turn,派发前再次比较同一库存。入队崩溃用例认回同一个 Turn,退出 130、Stop、撤权及同文更新保持原保护。失去原生 owner 的用例没有派发额外模型请求,失败仍能从原待办读回。基线与新版本都保留普通 work-1 和原有只读复核入口。
我的整体评价
实际私聊入口、Core、原队列及测试工作区形成了一个可复验的续办闭环。精确发布版本通过 8 个复核后用例、61 个 TypeScript 用例与本地 quick premerge。现有飞书消息布局及前端呈现组件没有改动。检查范围是原私聊投递回执和待办投影状态。 原生模型与飞书在隔离测试中使用 fixture,线上实际回传待采用后另验。正式合并资格由仓库维护者批准和必需检查决定。
English verdict: APPROVE. The existing worker can qualify one continuation from fresh evidence and retain a visible obligation after a held dispatch.
Problem
A delivered read-only result review could leave a typed unfinished project request outside Core's continuation candidates permanently. This stranded requests whose original effects could later be independently verified by the live owner.
Change
Core correlates the delivered review with the immutable original request, typed work declaration, and current project grant. The original worker can use its single existing
work-1reservation when fresh native inventory proves that the original work and all intervening effects have settled. The worker verifies the same inventory again before dispatch and returns the result in a separate delivery phase.A failed or gated continuation remains in the pending projection. The original partial answer, read-only review, and their delivery receipts stay attached to the request. A missing native owner, interrupted or unknown effects, stop, revocation, or an equivalent newer request holds execution.
Validation