Skip to content

fix(heartbeat): qualify inline scheduler prompts without memory - #6930

Merged
huangruiteng merged 2 commits into
mainfrom
codex/heartbeat-inline-scheduler-ack-20261020
Oct 20, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/heartbeat-inline-scheduler-ack-20261020

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Problem And Result

The opted-in TurnEnvelope heartbeat now uses complete inline scheduler ACK argv. It reads the original captured decision only for a needed missing/truncated/referenced command, and reads failure argv only after a Host update fails. The existing typed scheduler remains authoritative.

The original review also exposed a real no-Reward-Memory budget regression. Captured Envelope thin bodies now receive 400 additional presentation characters, for a 4,600-character allowance. Ordinary/capture-only thin remain at 4,200; the memory allowance remains 640. Native Goal's hard limit, other budgets, execution quota and authority are unchanged.

Written by: model_agent — OpenAI GPT-6 / Codex.

This five-file change reuses the renderer, budget owner, existing opt-in flag and native fixtures. It follows the existing scheduler contract and budget decision procedure. No new configuration, command or owner is added. Further extraction was unnecessary in this bounded refactoring pass.

Budget Evidence

The historical review measured e552168e3 → 9197abd8d at 3,551 → 3,653 against 3,600; that failure remains recorded. Independent native CLI measurements below bind registry/runtime and Goal/Agent/Turn, preserve complete routes, use a 128-character root, and disable Reward Memory:

Normalized captured body Default scope 320-character scope
Original base e552168e3, cap 3,600 3,587, pass 3,887, overflow
Original head 9197abd8d, cap 3,600 3,689, overflow 3,989, overflow
Main 82b1a8c72, cap 4,200 4,110, pass 4,410, overflow
This head 224bdbab1, cap 4,600 4,212, pass 4,512, pass

Simply adopting main's newer 4,200 ceiling still overflows by 12 characters. No lossless deletion of required conditions or complete outcome guidance was established, so the allowance is limited to this optional transport. File/SQLite agree, with 88 scoped body characters remaining. Longer inputs still report overflow.

Compact Agent JSON is 4,719 / 5,019 characters under the unchanged 5,400 ceiling; stdout with its newline is 4,720 / 5,020 characters and 4,724 / 5,024 UTF-8 bytes. Bodies have 38 lines and payloads seven top-level keys. The ordinary emitted thin matrix keeps its independent 4,500 ceiling. The ACK clause adds 102 characters/bytes; model compliance and total token/IO/latency benefit remain unqualified. The updated contract retains the measurements and tradeoff.

Validation And Remaining CI Hold

Tested head: 224bdbab150084db1d04200b662f8a27f7f09270. Qualification base: immutable main 33191bee46c609cbffc83f8b2fcb35b4606d38df; merge base: 82b1a8c72. Inputs are synthetic/public fixtures.

  • 83 final transport/wire cases passed, including native File/SQLite budgets, original-source recovery, argv references/truncation, overflow and exactly-once settlement. Another 34 settlement/Host-context/capture cases passed against the same production code.
  • Ten complete default-off packets match the target-main renderer across five modes with memory off/on; only the ACK clause and derived budget change in the two Envelope packets. Complete outcome guidance is preserved.
  • Declared Ruff roots, configured mypy (17 files), public-boundary/semantic/bilingual checks and the existing CLI budget smoke passed. Standard premerge passed 6 direct and 15 selected checks. The exact-scope change-quality receipt is valid.
  • An additional whole-loopx Ruff scan still fails 20 diagnostics in four untouched capability files. Immutable base/head executions retain identical complete diagnostics and workload/environment digests; these remain attributed failures, not passes.

The old release build and three browser jobs fail the same dashboard source assertion, Personal workspace prefers the registered Goal display name; the summary check consequently fails. Their actual checkout was CI merge 8fbad09f6c9a1a7b441272e82146e56f35180c14 over base 4b392c8328b7ba4451baefbd7812dcd3dcc580db and source head 9197abd8d.

The exact isolated assertion fails on that CI base/merge, qualification base and this candidate, but passes on original source head 9197abd8d. This distinguishes the integrated dashboard/test failure from the heartbeat regression. It is a source counterfactual, not a full browser/build rerun or UI-correctness claim. Required CI remains held; no check is waived.

UI impact: none; this refines the existing opt-in transport. Live installation/model adoption, Windows and complete CI qualification remain unverified. This is a finished author proposal; fresh exact-head review, required CI and maintainer merge authority remain separate. No installation, release, approval or merge was performed.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

Exact head: 9197abd8da943e0c09c200bb9ac40017cfab8734; immutable base: e552168e3c74dbcd568a1ee26d6112f261951017.

动机

启用 TurnEnvelope 心跳传输的 Agent 与操作者。ACK 的完整可执行参数已经在短包里时,旧提示仍要求再读取保存的完整决策,给每次调度确认增加没有新决策值的补读。新提示正确优先使用 inline ACK,仅在需要缺失、截断或引用命令时读同次捕获,Host 更新失败后才读 failure argv;但未启用 Reward Memory 的一组合法绑定输入现已超出既有正文预算。本次不改变实际 scheduler 决策、命令身份、写回或额度,也不启用默认 Envelope;不把提示词存在当作模型已经遵从或总成本已经下降。

本次依据是变更前的 docs/reference/protocols/turn-envelope-v0.md 与 docs/reference/contracts/interface-budget-contract.md,均读取 e552168e3c74dbcd568a1ee26d6112f261951017 的原文。前者已有 inline ACK、同次捕获、原参数及 failure 冷读边界;后者独立要求 within_budget=true 和 3,600 字符 thin 正文。下文 scheduler_inline_argv、same_capture_recovery、thin_budget 是这些既有条款的评审标签,不是新协议值。

改动思路

继续由现有 task-body renderer 表达已有 typed scheduler 投影,不新增状态、配置或第二套 ACK owner;这是已有读取义务的一处精确修正。当前边界只包含 opt-in Envelope 的指令及真实命令来源/恢复验证;还需补足无 Reward Memory 的展示预算资格,安装、模型采用与完整性能收益仍不在本 PR 的已证范围。不修改会继续强制补读;另建 scheduler 查询或改准入 owner 会扩大问题,因此保留这处 renderer 修改是合适选择。其余 guard 传输 flags、source hash、原 Goal/Agent/Turn 身份、重选、写回、vision 与停止义务都不应被省略。

条件 本次正确的读取义务
完整 inline ACK argv 已在投影中 直接使用现有 argv,并按原 Host readback/当前 mutation 校验
需要缺失、截断或引用命令 从同次保存的 full decision 取原参数,不能重新准入冒充读详情
Host 更新实际失败 此时再取 failure argv

同输入 public builder 对比证明只有该 clause 被替换,其余指令逐字相同;这证明输出语义的变化边界,不证明模型已经遵从,也不等于实际总体 token/IO 收益。

具体改动

[P2] 无 Reward Memory 余量时越过 thin 正文预算

新增 两行 Envelope 指令 增加 102 个规范计数字符,但测试采用 builder 默认 Reward Memory 余量,没有覆盖普通未配置该实验的真实 CLI。使用同一个合法 _write_fixture Goal,显式绑定 registry/runtime,并执行 heartbeat-prompt --thin --turn-envelope --decision-output-root ... --runtime-profile generic_cli:base 的 budget_char_count=3551 <= 3600,当前变成 3653 > 3600,within_budget 从 true 变为 false。两版 CLI 都退出 0;这是已声明展示回归预算的失败,不是执行额度或外部 Host 硬上限,也不声称命令被拒绝。

scheduler_inline_argv 与 same_capture_recovery 已实现,thin_budget 尚未满足。请补上无 memory 的绑定输入,并保留所有来源/条件义务,做有依据的文字整理或按已有 budget-decision 程序提出有限展示预算调整;不要删除必要的条件、只挑有额外余量的输入或静默忽略 false。

关键代码讲解

全 diff 仅两处生产行替换与同一测试模块的 import/回归。没有新 command、存储字段、budget 上限、默认开关、权限或 RFC 变更。相邻 renderer 已有适当 owner,本轮不要求为了小改动再做抽象。

对主干的风险

五个相关模块 47 passed,包含真实 File/SQLite 的 capture、原 source detail、选择、重放与结算;不可变 base 执行相同最终三个目标:旧指令 oracle 失败,两项原生 inline/来源控制本就通过。不能把后两项说成此 PR 新增的运行时能力。

相同公开 builder 输入下,full、compact、brief、普通 thin 与仅 capture 的 thin 完整 payload 全等;仅 Envelope 的新 clause 及派生预算字符/行数/within_budget 变化。独立真实 CLI 的 3551→3653 复现了当前预算失败,不以裸字符长度、不同 workload 或旧历史上限替代。完整 premerge 6 项直接检查、13 项选中检查均通过,说明现有门没有覆盖该输入;并不能覆盖它。没有查询或等待 CI,没有改限额、数据、Prompt producer 或安装任何共享版本。

语义与 CI 对齐

既有 interface-budget 合同要求 qualifying thin 正文在展示预算内;新的读取义务正确,但普通无 memory 输入越线。补对应 CLI 回归,并保留条件语义或按原程序论证有限预算调整。

模型是否遵从新读序、真实 App 采用和完整读/算成本仍未验证。此缺口只涉及 opt-in Envelope 的一类配置;没有发现普通禁用路径漂移或实际 scheduler 决策、额度、命令身份变化。新冷读条件是有价值的,修预算时也必须保持它。

我的整体评价

请求修改,理由是当前真实入口的展示预算回归;不否定正确的新读取顺序。继续由现有 task-body renderer 表达已有 typed scheduler 投影,不新增状态、配置或第二套 ACK owner;这是已有读取义务的一处精确修正。当前边界只包含 opt-in Envelope 的指令及真实命令来源/恢复验证;还需补足无 Reward Memory 的展示预算资格,安装、模型采用与完整性能收益仍不在本 PR 的已证范围。这类预算允许有证据的有限调整,应比较同输入增长和保留条件的信息价值,而不是删语义来过线。完成这项最小修复并补反例后即可重新核验;不要求新页面、全局重构或把模型采用研究变成本次额外门禁。

English verdict: REQUEST_CHANGES — 9197abd. Inline ACK/captured-source semantics are correct, but the same valid no-Reward-Memory bound CLI input grows from3551 to3653 against the unchanged3600 presentation budget and emits within_budget=false.47tests and6direct/13selected checks passed;five unaffected prompt modes match the base completely. Preserve the useful clauses and add the missing budget case/justified bounded adjustment. No CI consulted, model-adoption or merge claim.

Comment thread loopx/control_plane/heartbeat/task_body.py
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent loopx-agent changed the title fix(heartbeat): use inline scheduler ACK commands fix(heartbeat): qualify inline scheduler prompts without memory Oct 20, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Exact head: 224bdbab150084db1d04200b662f8a27f7f09270; immutable merge base: 82b1a8c72159dedcbca3a3b69fac2c7eaad3192d; actual PR base: main.

动机

启用 captured TurnEnvelope 心跳传输的 Agent 与操作者。完整 ACK 参数已经随短包返回时,旧提示仍要求再次读取保存的完整决策;当前提示先用 inline 参数,仅在命令确实缺失、截断或为引用时补读同次观察,Host 更新失败后才读取失败上报参数。真实 File/SQLite CLI 保留完整路径和原身份,并使无 Reward Memory 的默认及 320 字符 scope 输入都报告 within_budget=true;普通未启用输出保持完整一致。本次不改变 scheduler 决策、准入、额度、原命令身份或默认启用方式,不安装共享版本,也不把提示已生成当作模型已遵从或完整成本已经下降。

上次评审暴露的无 memory 预算失败仍按原失败保留。本次同时审读完整五文件变更及旧 9197abd8d 之后的修复,没有因为旧意见被回应而继承批准。新的主干已经加入完整成果指导,不能再拿旧三千六百上限或只用带 memory 余量的输入替代当前资格。实际模型遵从、安装态采用和总体 token/IO/延迟收益仍未验证;本 PR 只交付可执行入口的指令与展示预算资格。

改动思路

复用现有 heartbeat renderer、budget owner 和已校验的 transport flag;400 字符只归属 captured thin 展示,不把预算当作调度权限,也不另建命令来源或状态 owner。当前 PR 完整交付 opt-in captured thin 的 ACK 读取条件、原观察恢复和无 memory 预算资格;模型采用、安装及端到端成本资格继续由原有调用者承担。完整 inline ACK 本就是既有 typed projector 的能力,本次没有新建 ACK 执行器。正文只改一处读取条件,缺失/引用仍读原捕获,失败参数仍在真实 Host 更新失败后读取;其余任务、必读项、身份、范围、重新准入、成果、vision、停止及原 Turn 结算文字都保留。

下表绑定当前 head,说明已实测的输出区别;它不证明模型已经按提示减少读取。

同一输入路径 原 base 当前候选
Captured/无 memory/默认 scope 正文 4,110,限 4,200 正文 4,212,限 4,600
Captured/无 memory/320 字符 scope 4,410,报告超限 4,512,余量 88
五个普通模式 × memory 关/开 原完整 packet 十份完整 packet 相同
更大自定义范围 报告超限 仍报告超限

保留四千二百上限会使候选默认绑定输入也超出十二字符;未证明可以无损删除新的条件或完整成果指导。仅给受影响的可选 transport 增加四百展示字符,比截短执行路由、删义务或扩大所有模式更合适。没有需要额外抽象或迁移的同域重复 owner。

具体改动

依据是改动前 docs/reference/protocols/turn-envelope-v0.md @ 82b1a8c72159dedcbca3a3b69fac2c7eaad3192d,尤其 capture 身份/同次观察及 scheduler argv 条款;同时核对同 revision 的 docs/reference/contracts/interface-budget-contract.md 与预算决策程序。原文未给各条独立 ID,映射标签为:scheduler_inline_argv implemented,直接使用投影中的原 ACK、失败参数保持冷读;same_capture_recovery implemented,缺失/截断/引用只取原捕获并保留身份、哈希与当前写入验证;bounded_presentation_budget implemented,真实同输入测量和有限预算调整保留完整语义;opt_in_and_authority_parity implemented,普通输出及原生 Host 硬边界分开。新文档的预算表是待判断的取舍说明,不是自身的独立正确性 oracle。

关键代码讲解

  • render_thin_heartbeat_task_body 仅在原 captured 分支中把无条件补读改成明确的 inline/缺失/截断/引用/实际失败条件。其他正文与 base 逐字一致,不重新编写准入或结算配方。
  • build_interface_budget 新增的四百字符只在 thin 且 captured 时计入。原 memory 六百四十独立相加,普通 thin 仍四千二百;native Goal 四千硬限、JSON/字段/行数和实际额度不改变。超限仍如实返回 false。
  • build_heartbeat_prompt 沿用已有 capture validator,先验证实际目录、thin 与 host-owned Turn,再把同一已验证 flag 交给 renderer 和预算 owner;没有新开关、字段、持久记录或启用路径。

全五路径 +160/-4 已审读:三份生产文件只有局部接线和预算组合;四十六行双语文档记录旧失败、测量边界及余量,现有 transport 测试增加真实 File/SQLite、无 memory、原命令来源和超限控制。没有新增通用状态、第二个 scheduler、页面或独立 capability。Python 仍位于现有指令/IO owner,不要求无关 TypeScript 重写。

对主干的风险

没有发现阻塞代码问题。独立十个完整 Python 模块 333 passed,0 skipped,覆盖真实 File/SQLite guard、capture、原始 source、选择/重新进入、Host readback 及一次结算。原生 ACK/failure 引用能力在 base 已存在,本次不能把它计为新运行时能力;测试证明新提示没有破坏其边界,不能证明模型会服从。

独立同一 public CLI harness 绑定 Goal/Agent/Turn、registry/runtime,固定实际根路径为 128 字符,保留所有完整路径。两个 provider 均得到表中数值。候选 compact Agent JSON 为 4,719/5,019 字符,实际 stdout 含换行 4,720/5,020 字符、4,724/5,024 UTF-8 字节;两个正文均三十八行、payload 七个顶层键。没有把字符、字节或模型 token 当作同一指标,也没有把 CLI exit 0 当成预算通过:base 的范围场景确实输出 within_budget=false。

十份普通 builder 输出完整相同;两份 Envelope 输出只替换一处正文,增加一百零二字符并派生新预算。四组真实 CLI 的其余完整字段相同。四类无效 transport 的完整 ValueError 类型及消息保持,三组超长 scope 仍超限,native Goal 硬限制仍四千。完整 packet 比较仅替换各自拥有的临时根作语义对照,原 stdout、路由和预算测量均保留;没有缩短 scope、隐藏路径或只比较几个 code。

语义与 CI 对齐

本地标准 premerge 6 项直接检查+15 项选中检查通过,零 manual hold,含既有 CLI 预算、语义、双语和公开边界门。仓库声明的 Ruff 根通过,配置的严格 mypy 17 文件通过。额外 whole-loopx Ruff 扫描仍有二十条失败:在不可变 base/head 的完整诊断、位置、消息相同,四份因果文件 Git blob 相同;只归一化 checkout 根,且与本次范围无关。该额外失败保留,不能重标为绿或借此豁免别的必需检查。

按当前策略没有查询、轮询或等待 CI。PR 对旧 dashboard CI 的描述保留为作者证据,本次没有独立重读远端日志,也不宣称远端全绿或已完成最新 main 整合。当前 main 的 quota/turn-driver 与此分支已有差异;它们不是这五文件 diff,不借局部绿色检查声称组合版本通过。合并准备度与权限另行办理。

新增量是局部 typed flag 接线及数值展示余量,未创建共享语义词表。prompt 的来源/时序要求是 Agent 应遵守的步骤;实际 Host/identity/mutation 验证仍由原 owner 强制实施,文字存在本身不证明模型采用。默认关闭隔离与四百字符范围都有实证,没有把安装或 memory 可用性当成启用许可。

我的整体评价

可批准这个有明确边界的增量。long_horizon 为 preserved:原任务、范围、继续与停止、当前身份及一次结算义务保留;user_experience 为 preserved:现有调用者无需新设置或确认,普通路径不变,captured 路径能读到来源明确且资格化的提示。未据此推断实际少读了多少、模型理解程度或长程净益。

复用现有 heartbeat renderer、budget owner 和已校验的 transport flag;400 字符只归属 captured thin 展示,不把预算当作调度权限,也不另建命令来源或状态 owner。当前 PR 完整交付 opt-in captured thin 的 ACK 读取条件、原观察恢复和无 memory 预算资格;模型采用、安装及端到端成本资格继续由原有调用者承担。当前预算取舍保留了有用条件及完整路由,原失败、超长输入告警、可选 broad lint 失败和安装/模型未知边界均保留。没有需要为此强拆的新层、状态 owner 或仪式性后继;后续改动应继续用同输入预算和完整条款对照。此结论是精确 head 的公开代码评审,不执行合并或安装。

English verdict: APPROVE — 224bdba. The full five-file change preserves exact inline ACK/same-capture/failure conditions and qualifies the no-memory captured transport with a scoped400-character presentation allowance. File/SQLite bound CLI bodies are4212/4512 under4600 versus base4110/4410 under4200;10disabled full packets match and2enabled packets change only the102-character clause and derived budget.333tests, declared Ruff, configured17-file mypy and6direct/15selected premerge checks passed. The optional20-diagnostic broad lint failure is identical on immutable base/head. No CI, installed/model adoption, total-cost gain or merge authority claimed.

@huangruiteng
huangruiteng merged commit 51fcb04 into main Oct 20, 2026
30 of 44 checks passed
@huangruiteng
huangruiteng deleted the codex/heartbeat-inline-scheduler-ack-20261020 branch October 20, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants