Repository navigation
Keep scheduled successor waits from triggering heartbeat stalls - #8825
Conversation
Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent / gpt-6.1-sol / OpenAI / runtime_reported / reasoning effort max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
为定时后继与 Monitor 提前检查状态的 Agent。 在一个待恢复 Todo 和 watch-only Monitor 都未到期时,基线两次提前唤醒分别记下一次停滞,第二次触发重规划。 候选在 File 与 SQLite 上保持提前唤醒安静,留下的停滞与扣额都是 0。原回执重放保持同一 ID。 在同一 Goal 上推进运行时时钟到真实截止点。先到期的是后继时,准入选择原后继并返回显式恢复;先到期的是 Monitor 时,准入选择原 Monitor。 独立验证使用本地源码、两种实际存储和受控时间。已安装 App 的真实调度与真实模型采用待验证。
改动思路 / Approach
本 PR 的边界是 Codex App heartbeat 的自动停滞记录。 在原自动记录前复用 scheduler arbitration 已核实的未来时钟,保留原准入和回执拥有方。 把经过完整来源验证的等待期限交给已有 TypeScript 决策,原记录器只在尚需监督时追加。参考 docs/reference/protocols/goal-vision-replan-contract-v0.md 在 8ade78c 的 原定时等待契约。
具体改动 / Changes
- positive-wait-proof 已验证。record_automatic_heartbeat_stall 先探测原 Turn 的既有记录,再对还未记录的 monitor_quiet_skip 求证。scheduler arbitration 继续使用原范围、条件和运行时时钟,只有完整的正向等待能抑制自动追加。实际记录器 · 共享证明
- due-selection 已验证。同样的两个 deferred Todo 和 watch-only Monitor,在一份隔离 Goal 状态里取得相反的首次到期顺序。两种后端均选择对应原任务。定向回归
- receipt-and-unknown-source 已验证。当等待条件不受支持时仍记录一次停滞,随后重放保留原回执。只有定时后继的 Agent 路径与真实权限检查沿原契约。 新的 Python adapter 通过已有 transport 调用 projectBlockedSuccessorWaitObservation,原路继续核对绑定和 scope。Python adapter · typed 判定
对主干的风险 / Risks
受控时钟下四组对照都能在基线复现提前的两次停滞。源状态读回保持原期限,候选在到期前和选择到期工作时均无额度扣减。定向 Python 基线 76 项、候选 84 项通过,双方定向 TypeScript 62 项和 typecheck 通过。原摘要所有权检查在两个精确版本都指向 native_child_result_inbox.ts 第 109 行同一模式。该失败的代码和扫描规则没有被本 PR 改动。
我的整体评价 / Verdict
通过当前提交的代码审查。保留原时间证明及监督,使有效等待到期后仍能按现有入口选择原后继或 Monitor。实际 App 采用另行验证。
English verdict: APPROVE at 0e1dd3f. Proven timed waits no longer create stalled heartbeat observations. File and SQLite preserve the original receipt and select either due item through fresh admission.
…000 commits (#8759) * Deliver verified images in private Lark answers Signed-off-by: LoopX Agent <[email protected]> * Keep image retries behind new private Lark replies Signed-off-by: LoopX Agent <[email protected]> * Recover missing images from one verified private Lark reply Signed-off-by: LoopX Agent <[email protected]> * Use one wall clock for private Lark image retries Signed-off-by: LoopX Agent <[email protected]> * Recheck the original Lark reply before historical image writes Signed-off-by: LoopX Agent <[email protected]> * Verify private Lark image sources before every redirect Signed-off-by: LoopX Agent <[email protected]> * feat(coordination): add postgresql authority checkpoints and local-to-pg-seed exporter - Add authority_checkpoints table DDL and tenant-scoped RLS policies. - Store incremental delta in authority_commits and bounded checkpoints every 64 commits and on genesis cursor 1, resolving table bloat and the 20,000 commit recovery ceiling. - Implement scanCommitted bounded delta replay from covering checkpoint via AuthorityStateReplay. - Add setupPostgreSqlAuthoritySchemaAndRole for explicit schema installation and least-privilege restricted role assembly. - Add exportLocalToPgGenesisSeed with sanitization (expired leases, local absolute paths, .local/ references, Feishu IDs, private materials) and fail-closed privacy boundary scan. - Add loopx postgres setup and loopx postgres local-to-pg-seed CLI commands. - Add test suites for checkpoints, sanitization, role assembly, and CLI invocation. Signed-off-by: LoopX Agent <[email protected]> * Recheck the historical Lark reply before each media write Signed-off-by: LoopX Agent <[email protected]> * Retry Lark image uploads after an explicit App scope rejection Signed-off-by: LoopX Agent <[email protected]> * Honor original Lark stop and closure before deferred images Signed-off-by: LoopX Agent <[email protected]> * Recheck private answer control after Lark source read Signed-off-by: LoopX Agent <[email protected]> * Read the current Core session after delayed image controls Signed-off-by: LoopX Agent <[email protected]> * Fence private answer media dispatch with original controls Signed-off-by: LoopX Agent <[email protected]> * Keep Lark media checks with private delivery Signed-off-by: LoopX Agent <[email protected]> * Recheck Lark image sources after recording upload intent Signed-off-by: LoopX Agent <[email protected]> * Read both original Feishu messages together before media upload Signed-off-by: LoopX Agent <[email protected]> * Verify Feishu sources at the guarded image dispatch Signed-off-by: LoopX Agent <[email protected]> * Preserve pre-dispatch Feishu source and session validation Signed-off-by: LoopX Agent <[email protected]> * Recover and verify PostgreSQL checkpoint history with append-only privileges Signed-off-by: LoopX Agent <[email protected]> * Verify backup history to its captured cursor beyond 20000 commits Signed-off-by: LoopX Agent <[email protected]> * Generate explicitly synthetic secret fixtures at test time Signed-off-by: LoopX Agent <[email protected]> * Recover private image uploads when the Lark CLI cannot start Signed-off-by: LoopX Agent <[email protected]> * fix(chat): preserve the first Goal's registered conversation (#8798) * fix(chat): preserve the first Goal's registered conversation Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * test(chat): keep original Goal adoption compatible with Python 3.11 Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> --------- Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Avoid rereading delivered Lark settings records and empty queues Signed-off-by: LoopX Agent <[email protected]> * Recover private Lark images after a CLI descriptor limit Signed-off-by: LoopX Agent <[email protected]> * Enable existing checks and the original authorized Task in managed Chat Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Reuse the canonical boundary projection and narrow Task JSON types Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Keep confirmed Goal creation attached to its original Task (#8805) Reuse the existing C1 source observation guard Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Assert the lease source probe returned an observation (#8796) (cherry picked from commit 2c099be) Signed-off-by: LoopX Agent <[email protected]> * Recover an owed replan debit before the next host Turn (#8794) * Recover an owed replan debit before the next host Turn Consider the original Todo binding when an admitted replan has verified writeback. Require the exact spend receipt before another guard grants delivery, even if the Todo lifecycle has changed. Keep explicit selection on the same recovery path and let the existing settlement owner replay the original debit. Signed-off-by: LoopX Agent <[email protected]> * Preserve ordinary completed-Todo successor admission Signed-off-by: LoopX Agent <[email protected]> * Replay one validated Turn debit across concurrent observations Signed-off-by: LoopX Agent <[email protected]> * Validate original Turn spend terms before debit and replay Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * Keep conversation history rendering off the typing path (#8781) Signed-off-by: LoopX Agent <[email protected]> * feat(coordination): complete remote task lifecycle and opt-in gateway access (#8747) (#8765) * feat(coordination): add complete remote task lifecycle and opt-in gateway access (#8747) Align with PR #8747 (multi-loopx-agent-cloud-collaboration-v0) and remote-authority-task-service-v0 (#8508): 1. Extend RemoteAuthorityService with full remote task settlement: - Add 'complete', 'block', 'defer', 'todo_add', and 'snapshot' operations. - Enforce hard-lease fencing and claim-request ownership checks. - Settle completion receipts and deterministic cross-machine snapshot digests. - Maintain default-deny Tenant/Goal/Actor authorization and incarnation pinning. 2. Introduce controlled remote authority gateway in Python control plane: - Default-disabled access: local private Goals never connect to remote authority or leak local credentials. - Opt-in gateway metadata projection for explicitly configured goals and the 'loopx-quality-review' canary. - Fail-closed should-run health check when remote authority is unconfigured or unreachable. 3. Conformance and unit test coverage across TypeScript and Python suites. Signed-off-by: LoopX Agent <[email protected]> * test(coordination): assert subprocess readback before decoding Signed-off-by: LoopX Agent <[email protected]> * fix(coordination): qualify explicit remote task reads and lifecycle receipts Signed-off-by: LoopX Agent <[email protected]> * fix(coordination): preserve existing successors on remote completion Signed-off-by: LoopX Agent <[email protected]> * test(remote-authority): prove ordinary admission stays local Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * test(chat): preserve create-only intent in workspace selection smoke Signed-off-by: LoopX Agent <[email protected]> * Defer material inventory during configuration discovery (#8807) Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Defer report providers during Turn reads Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * test(core): require installed provenance before qualification Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Reuse the final source check for staged Turn requests (#8820) Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Defer PR wait provider loading until permission is checked (#8821) Load the optional PR reconciler only after the invocation-time observation permission check, inside the existing provider failure boundary. Preserve original permission, cadence, result and unknown-effect owners, and document the bounded default-closure and timing-window change. Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Load provider options only for the selected capability editor (#8822) Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * docs: describe README session continuity directly (#8823) * Skip automatic usage observers for supported opt-outs (#8824) * Skip automatic usage observers for supported opt-outs Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Record installed Core and C1 observer qualification Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> --------- Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * docs(blog): add EdgeBench controlled Context ON vs OFF 10-task score comparison (#8760) * docs(blog): add EdgeBench controlled Context ON vs OFF 10-task score comparison Signed-off-by: LoopX Agent <[email protected]> * docs(blog): use declarative mechanism-led opening in zh context-delivery score section Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(heartbeat): preserve proven waits before their due time (#8825) Signed-off-by: LoopX Agent <[email protected]> * Fix manager discovery in ordinary installs (#8830) * Package the manager discovery projection Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Record selected manager discovery distribution qualification Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> --------- Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * test(workspace): verify confirmed Goal creation against the current contract (#8816) Signed-off-by: LoopX Agent <[email protected]> * Fix Windows CLI output probe reader invocation (#8817) Port the probe fixture and native Windows regression coverage from e6eb92d and 8d200aa. Decode the generated PowerShell literals into argv before launching the pinned reader. Signed-off-by: LoopX Agent <[email protected]> * refactor(issue_fix): fold reviewer source trust/freshness vocabularies into one owner (#8826) reviewer_recommendation.py restated the trust and freshness sets that repository_context.py already owns. Import both as aliases of the owner objects so the decision has a single source, and add an architecture guard that pins single ownership by value, by identity, and by wiring through both public builders. REVIEWER_SOURCE_KINDS stays local (deliberately narrower). Signed-off-by: psychologister <[email protected]> Co-authored-by: psychologister <[email protected]> * fix(scheduler): reject superseded heartbeat receipts on the Python follow-up route (#8708) * fix(scheduler): reject superseded heartbeat receipts on the Python follow-up route The Python compatibility route for scheduler-ack-current/scheduler-fail-current checked only that the receipt for --turn-instance-id exists; a receipt already superseded by a newer heartbeat Turn still committed scheduler state, while the native TypeScript transaction rejects it as heartbeat_receipt_stale. Thread the Turn from build_scheduler_followup_payload through record_quota_scheduler_ack / record_quota_scheduler_ack_for_decision / record_quota_scheduler_failure_for_decision into _run_native_followup, which now sends turn_instance_id with require_heartbeat_receipt=true. The TypeScript transaction remains the single owner of the missing/stale/superseded fence (it also rechecks under the scheduler state lock); optional parameters keep the in-process API, which has no Turn, unchanged. Fixes #8605 Signed-off-by: Lihua <[email protected]> * Keep scheduler follow-up hint reads out of legacy migration Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: Lihua <[email protected]> Signed-off-by: LoopX Agent <[email protected]> Co-authored-by: LoopX Agent <[email protected]> * Resume the original quota settlement after lifecycle writeback (#8728) * fix(replan): resume settlement after lifecycle review writeback Signed-off-by: LoopX Agent <[email protected]> * Recover committed replan settlement before rebuilding its review Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(antigravity): keep the project registry in generated wakes (#8768) Signed-off-by: LoopX Agent <[email protected]> * fix(chat): keep workspace checker reads portable (#8814) Signed-off-by: LoopX Agent <[email protected]> * Reject external Turn retries when the captured work changes (#8828) * Recheck captured work before launching an external Turn host Signed-off-by: LoopX Agent <[email protected]> * Keep complete-source metadata assembly outside Turn planning Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * Preserve PostgreSQL runtime access and recover seed output retries Signed-off-by: LoopX Agent <[email protected]> * Validate recovery cursor metadata without a fixed history ceiling Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: psychologister <[email protected]> Signed-off-by: Lihua <[email protected]> Co-authored-by: Lusen Dong <[email protected]> Co-authored-by: TRAE CLI <[email protected]> Co-authored-by: Lusen Dong <[email protected]> Co-authored-by: psychologister <[email protected]> Co-authored-by: psychologister <[email protected]> Co-authored-by: Lihua <[email protected]>
Goal And Delivered Outcome
A scheduled successor and a watch-only Monitor can leave an agent with nothing due. Two early heartbeats previously recorded two stalls, which could reopen the plan before either deadline. The automatic recorder now uses the scheduler’s existing proof of a future wait and preserves the original deadlines.
The normal path still selects work when the successor or Monitor becomes due. An unproven wait still records a stall, and an existing receipt can be replayed.
Author Declaration
Written by OpenAI Codex. The exact blocked-successor wait contract provides the requirements for source proof, normal work when due, and receipt replay.
Validation
Tested revision
0e1dd3f2de049edc80f5c3ac6c3f6863804c99eawith synthetic inputs.real_entrypointpassedquota should-run --codex-app. Both early wakes remain quiet, same-turn replay uses the original receipt, either due item is selected, and an unproven wait still records a stall. The early-wake cases check stored observations and quota.regression_paritypassedunitpassedstaticpassedintegrationpassedintegrationfailed8ade78cddeband on this commit. It reports the matcher inloopx/control_plane/capabilities/native_child_result_inbox.ts:109.integrationrunningThe standard premerge commands passed before the full TypeScript result. The quality receipt now records the failed validator. The PR is available for review while the baseline failure is addressed.
Frontend / Visual Evidence
UI impact is
none.Type of Change
LoopX Area
Boundary Checklist
none.Signed-off-bytrailer.