Repository navigation
fix(chat): resume retained reports after native replanning - #7302
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=GPT-6; provider=OpenAI; self_reported.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
已启用周期报告的原管家或 managed Session,会在原生守卫要求重规划时漏掉本期报告:上一期已完成,下一期的精确 Task 在模型启动前被拒绝;空闲生产者以后只读到这个保留请求,报告便一直等待。
本次让原 Agent 先完成原生重规划,再重新准入同一个报告 Task,并沿原对话返回完整正文。File 后端的实际 pump 在修复前复现了“执行前拒绝后不再推进”;修复后 File/SQLite、原私聊/普通 Session 的实际原生存储与 worker 路径均贯通。等待和无效语义证据也实测保留,不消耗完成额度或反复调用模型。
这是可独立验收的恢复修复。完整自然语言任务编排、统一 Agent 前端、真实安装后的报告内容质量及自然到期效果仍由既有产品工作验收;本评审不关闭这些要求。
改动思路
复用原空闲生产者、原 worker、Turn、语义重规划义务和报告发布者。内部准入读取原生拒绝的 typed receipt,确认模型、写回、额度与调度效果均明确未发生;随后只允许一次有关联的继续。它先执行有签名义务与结算身份的重规划,通过现有 writeback dry-run 独立验收后提交,再对原窗口 Task 重新做新鲜准入。报告完成和消息送达继续分别验收。
本次可用边界是原生执行前重规划拒绝的报告恢复;完整 Agent 产品与真实运行验收继续由既有工作保留。
| 触发或结果 | 行为 | 验证到的结果 |
|---|---|---|
| 原生执行前拒绝,要求重规划 | 原 Agent 沿同一 worker 先处理义务,再执行原窗口 | 重规划提交、本期 Task 完成、原完整正文送达;重复检查无新增模型或发送 |
| 重规划等待或语义证据无效 | 保留原窗口、Task、拒绝和新执行证据 | 本期未生成,无状态/额度提交,后续检查不重放 |
| 已执行、部分或未知效果,授权改变 | 原 typed owner 拒绝新继续 | 不把事件缺失当成没有副作用,不抹除原结果 |
不新增日历、消费者、模型执行器、顶级命令或持久任务权威。普通业务的 delivery 门禁继续生效;只有原生 quota 已选定、签名且绑定确切义务的治理路径可执行。
具体改动
依据修改前的 managed Agent execution contract 与 原生 Turn 的签名结算身份规则,版本均为 af68b0ff180ca8309b5d63d7ee326c77848521bb。本次补充的恢复说明不作为自己的独立验收标准。
- NR-IDENTITY / NR-OWNERS:保留原 Agent、Goal lifetime、Session、线程、单 worker、日历窗口和返回者;原失败 Chat 文件逐字节保留。
- NR-GOVERNANCE:本期报告被拒绝后,重规划绑定原 quota 义务;不借用其 fallback 业务 Task 的结算身份,也不解除普通交付禁行。
- NR-VALIDATION / NR-RETURN:治理通过同一 canonical semantic writeback preview 验收,实际提交再次检查;报告仍走独立生成验收、lease、native commit 和完整原消息回读。
- NR-REPLAY:明确执行前拒绝只准入一次关联继续。等待、无效证据、未知副作用和重复 pump 均不能获得下一次业务重放。
- NR-JOURNEY:上述完整产品与真实运行验收仍保留,不把一个报告 Task 的完成升级为父 Goal 完成。
关键路径已逐符号读回:
admitReportSelectionRecovery复用原生readTurnSelectionRejection,核对原请求、原 Session、准入健康、原始拒绝种类与四项明确为 false 的效果。窗口、订阅、Goal 与队列的既有门禁仍参与准入。StewardTurnHost.submit与ManagedSessionTurn.submit保留原请求身份,只生成一个关联 continuation;已有继续直接读回。report_selection_recovery读取冻结原窗,已有生成不能走模型恢复。StewardTurnHost.execute沿原线程先执行治理。只接受原生 replan packet,治理时不给报告 completion 或 editorial contract;提交成功后才回到原 Task。失败会保留原拒绝和单独的治理结果事件。_attach_original_replan_settlement与_typed_route消除原生治理被普通 delivery=false 错挡、以及 fallback Task 误入治理结算的冲突。无签名身份、错误义务、should_run/must_attempt 禁行和普通业务仍拒绝。execute_turn_run_once让无业务 Task 的治理复用 canonical refresh dry-run 独立验证;未验证的 progress/completion 声明不能替代语义验收。治理不冒充仓库代码交付的 workspace 因果,实际写回与扣额仍由原 effect owner 执行。
其余变动是现有 Task lease 的关联重试 key、原报告返回者的复用、持久集成测试和产品说明。没有修改前端渲染路径或新增交互确认。
对主干的风险
最危险的反例是把未知模型执行当成纯拒绝,然后重复业务。TypeScript 准入对原 Core、请求和全部副作用作正面证明;仅 delta=0、缺事件或错误文本都不充分。新的继续失败后仍保留原失败,下一次检查只读回。治理的独立验收预览不写状态;真实结算再次检查当前源、义务与原生守卫,报告 Task 与原消息发布各自持有原验证。
共享行为变化限于具有有效签名结算身份、当前 Agent scope、should_run/must_attempt 以及原生重规划义务的治理路径。普通业务不会继承这个例外;停止 Goal、失效 Agent、忙碌队列、关闭/未来报告和未知效果的既有负例保持。没有新增 opt-in 开关或自动注册:未启用报告和未准备身份的生产者路径仍不启动模型。完整所有调用者的性能或内容质量并未据此认证。
语义与 CI 对齐
复用注册的 EffectiveAction.AUTONOMOUS_REPLAN_REQUIRED 与现有 replan_action_packet_v0、签名义务身份及 typed refusal。新增的是内部关联证明与审计事件;不创造新的 actor、全局义务或数据访问权威。语义 advisory 未发现受支持的新 carrier,仍手工检查了这些动态语义。首次 premerge 捕获了一个未注册的旧 action literal;已使用 canonical Enum 修复,原失败保留,未改 registry 或降低门禁。
精确 head d7cffc3527bbeaaae58a478af5333353372d4b37:402 passed,其中报告/managed/monitor/Lark 228 passed in 715.76s,Turn/日历 174 passed in 208.08s;18 个目标恢复/治理用例通过,7 个 TypeScript owner 用例和 control-plane typecheck 通过;最终 standard premerge 的直接检查、8 项 catalog、8 项风险及 scoped public boundary 全通过。File/SQLite × 原私聊/普通 Session × 成功/等待/无效语义的 12 路径验证了实际模型调用、原窗口、native commit、独立完整正文回读及重复检查。模型与 Lark provider 为合成 oracle;原生准入、存储、结算、worker、报告生成和发布回读是真实路径。当前 wait_for_ci=false,未查询或等待远端 CI。
我的整体评价
结论 APPROVE,justified_increment。原管家能在原生反馈要求重规划后实际完成后续工作和原消息返回,长程行为 improved;用户无需补发或增加确认步骤。未知结果继续保守持有,属于保留证据和防重放边界。
10 个文件新增 397 行、删除 30 行,覆盖原适配器、三处共享 Turn 接线、typed admission、原有测试与说明。替换 guard 或另建执行循环都会绕开原生权威;当前复用原有所有者,在同一请求中闭合必要链路。无渲染改动,视觉验收不适用。生产安装后的自然到期、真实内容质量和剩余 Agent 产品旅程仍未由本代码评审认证。
English verdict: APPROVE at d7cffc3527bbeaaae58a478af5333353372d4b37 for a justified native report-recovery increment. A proven pre-execution replan refusal now leads through the original Agent, signed governance, independent canonical preview, native settlement and the retained report’s full original return. Exact-head File/SQLite and private/local Session scenarios preserve unknown-effect and duplicate protections. Full production and parent product acceptance remain open; no remote CI was consulted under policy.
A scheduled report could remain pending indefinitely after the native guard deferred its exact Task for an autonomous replan. The original idle producer retained the refused Chat request, so it never completed governance or resumed that same report window.
Qualify the native pre-execution refusal, admit one correlated continuation through the original worker, and settle the original Agent’s signed replan before freshly admitting the retained report Task. The native semantic writeback preview independently validates governance; the existing report validator and full-body publication owner retain delivery. Failed or unknown effects remain held, and the original Chat request and window remain in history.
The same path serves original private stewards and local managed Sessions. General conversational task authoring and the remaining Agent journey continue under their existing work.
Validation: 402 exact-head native report, managed Session, monitor, Lark, Turn and calendar regressions pass (228 + 174); the 18 targeted governance/recovery cases also pass. All 7 typed-owner tests, control-plane typecheck and the standard premerge gate pass. Original pre-execution refusal, failed semantic validation, waiting, duplicate/restart handling and full original return are covered on File and SQLite. Remote CI is not consulted under the configured policy.