Repository navigation
Retire legacy heartbeat work prompt generation - #9054
Conversation
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
已有计划任务的 Agent 每次醒来会用保存的 bootstrap 读取本机最新工作规则。打开可见 Goal 的 Agent 也从同一工作契约取得必读、选择和结算命令。主干的实际入口已使用完整工作契约,旧提示词仍暗示可以从备用 envelope 判断必读,并保留了一套无调用者的指令和额外预算。已进行中的历史捕获则确实需要自己的读取路径。当前提交让重新唤醒的入口只引用本轮工作契约。经核验,已存 bootstrap 仍能加载当前命令并接续原 Turn,老捕获也可按原来保存的路径恢复。本次验收范围是提示词生成和历史读取兼容。正式 App 采用及完整 C1 成本仍属后续验收。
改动思路 / Approach
保存的 bootstrap 仍只负责加载提示词。quota guard 提供实际必读、通知、停止和结算义务,历史捕获由原 reader 负责。从生成器移除无调用者的分支后,这两处职责都可以沿原入口验证。当前切片覆盖 thin heartbeat 和可见 Goal 的指令生成及预算。历史读取、存储和收据仍由现有 owner 处理。实际采用与成果成本比较由原 C1 交付继续验证。用同一个主干生成的 bootstrap 指令在两个版本回放。先比较完整提示词,再沿其实际 guard、来件必读、结算重试及后续 Stop 验证。另由切换前版本写入历史捕获,持续使用它原记录的读取入口。
具体改动 / Changes
精确 head 57e14cc3047f3dca38c033c15dc7eef5ef69b414,diff base 41ea75e89892ed88d0ae543e97e31aad0a181c47,8 个文件 +22/-88。逐项复核 current-loader、obligations-and-settlement、historic-recovery。验收约定
关键代码讲解
- 基础版本保存下来的 bootstrap 在候选运行后重新生成指令。各入口的 guard argv 和预算上限相同。源码
- thin 和可见 Goal 统一引用 interaction_contract。四个有来件的 Codex fixture 执行了 before_work 的实际读取。源码
- 绑定提示词指向原 settlement_plan。两种存储的真实刷新和重复请求各保留同一效应和原收据,分别只扣一次。源码
- 从当前生成器删掉独立的旧预算额度。奖励记忆的额度仍由既有条件控制。源码
- 两个真实旧版本 v0 捕获按原记录和摘要恢复。错 Turn 与错误摘要均被拒绝,原文件及收据不动。源码
对主干的风险 / Risks
十组 heartbeat guard 覆盖 File、SQLite 及五种当前路线,另有六组可见 Goal 指令比较。两个 Codex Stop 都投影需验证的暂停,未授予新任务或新扣额。308 项相关源码测试通过,14 项跳过。独立 base/head 对照复现十项继承失败,原测试仍预期手动扣额、v0 或跨 host 重绑。当前路径的真实对照与旧版本原捕获均已执行。双语、DCO 和八文件公开边界检查通过。
语义与 CI 对齐
用途、动作顺序、必读、通知与原 Turn 身份由现有 contract 和收据决定。源指令对照只少了备用 envelope 说明。Stop 单次暂停及读回条件保留,当前评审在隔离环境核对了投影,正式宿主采用仍待验证。
我的整体评价 / Verdict
批准当前精确提交。删除无调用者的提示词分支有明确边界,旧 bootstrap 可恢复工作,两个 provider 能按原身份重放结算和历史读回。已安装 App 采用、剩余历史 reader 退出与完整成果成本仍需原后续验收。
English verdict: APPROVE. The saved bootstrap reloads one current contract, preserves required reads and Stop, and settles once at the original identity on File and SQLite. Named historical v0 capture replay still works. Production App adoption remains unverified.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
57e14cc to
3495df1
Compare
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · GPT-5 · OpenAI · self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
受影响 caller 是所有由 heartbeat 生成提示词的 Codex App、SSH Goal 等宿主。旧路径仍可能额外生成一段只属于 TurnEnvelope 展示别名的说明,并给 thin prompt 增加 400 字符预算。新路径已经统一交付 interaction_contract,继续保留第二套说明只会让同一次工作出现两个表述,既浪费宿主预算,也容易与新契约不一致。该 PR 停止为新提示生成旧说明,同时保留历史 capture 的原有 reader。No quota admission, Goal completion, host permission, model behavior or historical capture schema is changed.
具体 old_behavior 是 captured-envelope prompt 可能携带重复段与额外预算;修后 before_after_scenario 为新生成提示只有一条完整契约,旧 capture 仍由记录 reader 读取。observable_outcome 是生成提示只剩一个 contract path、400 字符额外 allowance 消失且旧保存仍可读。
改动思路 / Approach
入口仍是现有的 heartbeat prompt 与 task-body renderer。新的生成过程只读取 interaction_contract,把目标选择、必读和原 Turn 结算绑定到同一份机器可读契约;预算恢复为 ordinary thin 或 visible Goal 的原值。历史保存内容继续沿记录中的 reader 恢复,不做迁移,也不新增第二套状态或调度入口。The current interaction_contract owns the removed obligations, and historical recovery has a separate reader. 本次 current_pr_boundary 是 Retire the captured-envelope-only new-generation prompt and budget while preserving historical capture readers.
具体改动 / Changes
精确 head 3495df117229483b5104f0a68cb93034bc676de2,diff base 036a95fb1a,8 个文件 +22/-88。规范引用 docs/architecture/rfcs/controller-executor-unified-contract-v0/contract-and-context.md @ 036a95fb1aac866526dc2409e0468c25bc656a3d。双语 RFC 的 one-current-prompt-contract 与 historical-capture-recovery 两项均已落实。
关键代码讲解
bind_exact_turn_settlement_task_body始终指向interaction_contract.cli_channel.settlement_plan.ordered_steps,不再选择已退役的 captured-envelope 路径。render_thin_heartbeat_task_body删除专门的 TurnEnvelope 提示分支,普通 thin prompt 仍保留 host safety、必读、写回和策略尾部。build_interface_budget移除 captured-envelope-only headroom;普通 thin 与 visible Goal 的既有上限没有放宽。
对主干的风险 / Risks
最强风险是删除重复说明时误删必读或结算义务。当前实现没有整体缩短 prompt,而是把同一义务固定在现有 interaction_contract 路径;历史 capture 仍使用自己的 reader。PASS:37 项 heartbeat prompt/budget 测试通过;quick premerge 通过,含 diff hygiene、双语 RFC、Python compile、quota routing 和 public boundary。继承的 maintainability advisory 位于本 diff 之外,按仓库策略记录但不阻断。安装态模型行为与完整成本仍属于 C1 后续验收。
语义与 CI 对齐
本次不新增权限或调度语义,只退役旧的提示呈现词汇。必读、Stop、宿主上限和原 Turn 结算仍由原 owner 持有,因此没有把“减少文案”变成“减少义务”。
我的整体评价 / Verdict
批准当前精确提交。长期任务上,少了一套会漂移的提示来源;用户体验上,宿主预算更可控且仍保留完整工作契约。代码变化以删除为主,复用现有 renderer 与 reader,没有引入迁移或平行协议。The current interaction_contract owns the removed obligations, and historical recovery has a separate reader; 本次边界是 Retire the captured-envelope-only new-generation prompt and budget while preserving historical capture readers.
English verdict: APPROVE at 3495df1. New heartbeat prompts use one interaction_contract path without the retired envelope prose or budget, historical captures remain readable, 37 focused tests and quick premerge pass.
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · GPT-5 · OpenAI · self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
受影响 caller 是所有由 heartbeat 生成提示词的 Codex App、SSH Goal 等宿主。旧路径仍可能额外生成一段只属于 TurnEnvelope 展示别名的说明,并给 thin prompt 增加 400 字符预算。新路径已经统一交付 interaction_contract,继续保留第二套说明只会让同一次工作出现两个表述,既浪费宿主预算,也容易与新契约不一致。该 PR 停止为新提示生成旧说明,同时保留历史 capture 的原有 reader。No quota admission, Goal completion, host permission, model behavior or historical capture schema is changed.
具体 old_behavior 是 captured-envelope prompt 可能携带重复段与额外预算;修后 before_after_scenario 为新生成提示只有一条完整契约,旧 capture 仍由记录 reader 读取。observable_outcome 是生成提示只剩一个 contract path、400 字符额外 allowance 消失且旧保存仍可读。
改动思路 / Approach
入口仍是现有的 heartbeat prompt 与 task-body renderer。新的生成过程只读取 interaction_contract,把目标选择、必读和原 Turn 结算绑定到同一份机器可读契约;预算恢复为 ordinary thin 或 visible Goal 的原值。历史保存内容继续沿记录中的 reader 恢复,不做迁移,也不新增第二套状态或调度入口。The current interaction_contract owns the removed obligations, and historical recovery has a separate reader. 本次 current_pr_boundary 是 Retire the captured-envelope-only new-generation prompt and budget while preserving historical capture readers.
具体改动 / Changes
精确 head 3495df117229483b5104f0a68cb93034bc676de2,diff base 036a95fb1a,8 个文件 +22/-88。规范引用 docs/architecture/rfcs/controller-executor-unified-contract-v0/contract-and-context.md @ 036a95fb1aac866526dc2409e0468c25bc656a3d。双语 RFC 的 one-current-prompt-contract 与 historical-capture-recovery 两项均已落实。
关键代码讲解
bind_exact_turn_settlement_task_body始终指向interaction_contract.cli_channel.settlement_plan.ordered_steps,不再选择已退役的 captured-envelope 路径。render_thin_heartbeat_task_body删除专门的 TurnEnvelope 提示分支,普通 thin prompt 仍保留 host safety、必读、写回和策略尾部。build_interface_budget移除 captured-envelope-only headroom;普通 thin 与 visible Goal 的既有上限没有放宽。
对主干的风险 / Risks
最强风险是删除重复说明时误删必读或结算义务。当前实现没有整体缩短 prompt,而是把同一义务固定在现有 interaction_contract 路径;历史 capture 仍使用自己的 reader。PASS:37 项 heartbeat prompt/budget 测试通过;quick premerge 通过,含 diff hygiene、双语 RFC、Python compile、quota routing 和 public boundary。继承的 maintainability advisory 位于本 diff 之外,按仓库策略记录但不阻断。安装态模型行为与完整成本仍属于 C1 后续验收。
语义与 CI 对齐
本次不新增权限或调度语义,只退役旧的提示呈现词汇。必读、Stop、宿主上限和原 Turn 结算仍由原 owner 持有,因此没有把“减少文案”变成“减少义务”。
我的整体评价 / Verdict
批准当前精确提交。长期任务上,少了一套会漂移的提示来源;用户体验上,宿主预算更可控且仍保留完整工作契约。代码变化以删除为主,复用现有 renderer 与 reader,没有引入迁移或平行协议。The current interaction_contract owns the removed obligations, and historical recovery has a separate reader; 本次边界是 Retire the captured-envelope-only new-generation prompt and budget while preserving historical capture readers.
English verdict: APPROVE at 3495df1. New heartbeat prompts use one interaction_contract path without the retired envelope prose or budget, historical captures remain readable, 37 focused tests and quick premerge pass.
Change
Retire the unused
captured_envelopeprompt generation for thin heartbeat and visible Goals, the old settlement-path choice, and its 400-character budget allowance. New prompts direct agents tointeraction_contractfor required reads and exact Turn settlement. The live generation callers already use this contract. The remaining prose change removes the obsolete alternate read direction.Saved bootstrap wrappers reload the current generator on wake. Already captured work continues through its recorded recovery reader. The bilingual C1 caller map records this boundary.
Verification
41ea75e89892and head57e14cc3047f. Saved wrappers from main reloaded on the candidate. Ten File and SQLite combinations covered Codex, Trae, Antigravity, generic CLI, and Codex with context delivery Off. Three visible Goal prompts were compared as well.Production App adoption, remaining historical-reader exits, and matched single-session outcomes and complete costs remain open.
Author declaration
Implemented by
model_agentusing OpenAI Codex.