Repository navigation
fix(chat): continue reports after host-only admission stops - #7306
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>
…n-handoff-20261025 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; GPT-6 family; OpenAI; self_reported. Host execution attribution unavailable (session_not_found).
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
启用原生周期报告的私有管家与普通受管 Agent Session。 原 Bot 曾在模型执行前被要求重规划,后续原生检查已允许正常工作,旧宿主仍停住日报;现在验证那次宿主停止后,原 Bot 可重新申请同一份日报的准入。 同一窗口通过原工作队列只生成一次,保留独立任务验收,并经原会话回传完整正文;需要重规划时仍先通过原生语义验收。 不增加消费者或新调度器,不重放有模型执行或效果未知的失败,不扩大项目授权。 自然触发的线上日报仍须在安装后独立验收;任意自然语言任务与完整 Agent UI 继续由既有产品任务承接。
改动思路
保留既有 typed 准入 owner、原生 journal 与原队列;Python 只运输 canonical 观测并编排宿主,不设第二套业务分类或调度 authority。 本 PR 只修复报告在已证明无模型执行的历史宿主停止后重新请求原任务准入;安装和自然送达另行读回。 不改动会让已到期报告持续卡住;直接重试所有没有输出的请求又无法排除已发生的模型或外部效果。因此复用原恢复入口,要求读取同一次 Core 请求所对应的原生 journal,并由独立检查器确认它只执行了内置宿主的准入停止分支。之后仍由新的原任务准入决定能否实际工作。
| 当前条件 | 结果 |
|---|---|
| 仍需语义重规划 | 原 Agent 先产出语义增量,经独立验收和原生结算后再申请原报告 |
| 当前准入允许普通工作,且旧停止有完整无模型证据 | 原队列重新申请同一报告任务;只需报告本身的模型调用 |
| 模型执行、效果未知、原会话或窗口变化、已冻结生成物 | 保留原记录,不新增模型重放 |
这个表是依据 74d22e8 源码的说明,不是执行证据。实际 File/SQLite、私有与普通 Session 的回归覆盖了新旧宿主两条路径,重复轮询不再生成或发送第二份正文。
具体改动
规范依据:docs/product/periodic-reports.md,spec_revision bd038d4f3ca9ec22b06df112c151f6458d2653d3。按变更前的原生报告生命周期判断:original-window 已实现,原 actor、Task、窗口、会话与正文回传不变;native-governance 已实现,仍欠重规划时必须独立验证语义增量再结算;unknown-work 已实现,未知效果和冻结生成物不获得新模型重放;current-admission 已实现,最终仍进入当前原生 exact Task guard。旧说明把历史拒绝等同于当前仍欠治理,本次有意修正这个假设;没有把仍需治理的路径降级为直接报告。
关键代码讲解
- StewardTurnHost.report_selection_recovery 从原 Core 事件读取唯一的原生 key,装载 canonical journal 和独立 inspection;Python 只运输事实,不用“没有模型输出”推断安全。
- admitReportSelectionRecovery 在既有原拒绝、当前来源及窗口校验后,进一步检查宿主类型、次数、阶段、停止分类、身份一致性和无 write/spend/ack 的已知效果。直接复用
EffectiveAction.NORMAL_RUN。未选定 guard 给出的另一任务建议不会成为报告执行授权。 - StewardTurnHost.submit/execute 对旧宿主已停止的那一次请求至多增加一个稳定关联的 continuation;原 native report identity 保留,租约使用当前 Core 关联,随后仍执行原任务的全新 guard、独立验收、原生结算与原发布 owner。
- ManagedSessionTurn.submit 复用同一个 typed proof,使普通受管 Session 与私有管家遵循同样规则。现有测试文件增加八个组合场景及严格反例,产品文档说明条件与边界;没有增加命令、模块、任务存储或调度器。
对主干的风险
主要风险是把不确定的旧执行当成无效果失败。现在只有已证明的内置宿主准入停止可请求继续;模型 delta、upstream、错误、错误窗口或身份、不完整 inspection、额外宿主尝试、写入或额度效果都会拒绝。后续 fresh guard 仍可拒绝,不能靠旧 proof 绕过暂停、撤权、源变化或当前任务选择。
最终头 74d22e83cda229201bf1fa5c954e898181bb3304 已集成任务路由迁移以及重规划上下文/receipt ownership 的最新主干。原生报告/宿主/监控/回传五组共 236 项通过;日历、quota route 与重规划上下文/写回共 100 项通过;TypeScript 42 项、严格 typecheck 和 standard premerge 全通过。最新基线运行相同当前回归 fixture,在实际 report commit 断言失败;本头在原工作队列、真实 File/SQLite、原生 guard、lease、validator、settlement 与完整正文读回边界通过。模型和外部消息 transport 为合成测试,线上采用与自然送达未由这些测试证明。按本 Goal 的 wait_for_ci=false,本次没有查询或等待 CI。
语义与 CI 对齐
首次 required semantic smoke 报出新增 bare action literal;已改为统一枚举,并重新通过完整门禁,没有更改扫描范围或放宽预算。动作 vocabulary、未知效果边界、原生 admission 和 quota owner 均复用;新内部 proof 只是 canonical 观测。历史 fixture 参数和模型计数断言修正保留在本地测试记录,当前结论来自最终组合源码的完整运行。
我的整体评价
结论 APPROVE,交付判断为 justified_increment。long_horizon improved:已证明无模型执行的历史停止有有界继续路径,原结果保留且重复检查不增加模型或发送;user_experience improved:沿原会话自动恢复,零新增确认轮次。steward_turn.py 与 steward_managed_mode.ts 只改变后台恢复准入,没有修改渲染层;沿用原会话与报告正文回传,不新增用户配置或确认。 unverified_scope:线上安装与自然送达;本 PR 没有新的视觉界面。
兼容分支保留的是可验证的旧 canonical 宿主停止,不是通用失败重放。规模与故障相称,采用既有 owner 的小范围扩展,不设第二 authority。保留既有 typed 准入 owner、原生 journal 与原队列;Python 只运输 canonical 观测并编排宿主,不设第二套业务分类或调度 authority。 本 PR 只修复报告在已证明无模型执行的历史宿主停止后重新请求原任务准入;安装和自然送达另行读回。 仍应安装后核验实际原 Bot 的原消息回传;完整自然语言任务与 Agent UI 不能因本修复被标为完成。无未解决阻塞 finding。用户已授权本修复自合并与安装,但发布评审、approval closeout 和 fresh merge-readiness 仍分别执行;原生自动合并保持关闭。
English verdict: APPROVE — 74d22e83cda229201bf1fa5c954e898181bb3304. Proven host-only report admission stops can request fresh admission of the original Task once. Native governance, unknown-work exclusions and original full-body delivery remain owned by their existing boundaries. Local exact-head validation passed; live adoption and natural delivery remain separately observable.
A retained calendar report can keep an earlier pre-execution replan refusal after the current native guard permits ordinary work. The original worker now proves the canonical host-only admission stop, then requests fresh admission of the same report Task. It preserves the original native identity, independent validator, report window and full-body return path.
The existing shared typed owner checks the original refusal, Chat identity, canonical journal, inspection and known effects. A stop retained by the previous host can continue once under a separate Chat correlation and current-Core lease key. Model-bearing or unknown work is never replayed; an unrelated unselected advisory Task grants no report authority. Required semantic replanning retains its independent validation and native settlement.
Validation at final head 74d22e8: 236 native/report/host/monitor/return tests, 100 calendar/quota-route/replan-context/writeback tests, 42 TypeScript tests, strict typecheck and standard premerge all passed. Eight new File/SQLite × local/private × fresh/retained scenarios cover full-body original return without duplicates. The identical current fixture fails against the latest pre-change main at the native report-commit postcondition. Integrated task-route and replan-context changes are covered. Initial bare action literals failed the semantic gate and were replaced with the canonical EffectiveAction import; the full gate then passed. Model/provider transport is synthetic. Live installation and natural original-audience delivery remain separately verified.