Skip to content

Preserve scheduler reconciliation during recovery waits - #8851

Merged
loopx-agent merged 3 commits into
mainfrom
codex/preserve-recovery-scheduler-detail-20261116
Nov 16, 2026
Merged

loopx-agent merged 3 commits into
mainfrom
codex/preserve-recovery-scheduler-detail-20261116

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Three unchanged recovery admissions move an unsettled Turn into an owner wait. The late recovery projection rebuilt its scheduler hint without the requested local detail, the host's current RRULE or the previously acknowledged backoff. The DSH Driver lost its recheck interval. Codex App could ask to rewrite an already matching automation, and the standalone Core launcher placed the ACK's registry arguments before the Python module selector.

Change

  • Reuse the shared scheduler projection with the opt-in detail selector, the host's observed RRULE and the existing backoff state. A matching host now requests an ACK only when needed. Replaying that receipt after acknowledgement returns no host action. A drifted RRULE still requests reconciliation.
  • Keep the registered agent identity for local recovery under a remote-authority binding. Bind the ACK and failure commands to the originating registry, runtime and Turn. Put the global CLI flags after the standalone Core interpreter prefix.
  • Keep the existing recovery limit and zero-spend wait. An unselected DSH Turn can still complete without entering the bound recovery flow. #8577 · #8563

Validation

  • The File and SQLite probes on the previous head reproduced a rewrite request for a matching 30-minute host RRULE. The packaged candidate passed File and SQLite across the local decision path and the remote-binding recovery path. Each case discovered the host rule, ran its generated ACK, left the automation file byte-for-byte unchanged, replayed the same receipt with no action, and requested an update when the observed rule drifted. All four cases recorded zero quota debits.
  • Ruff and all 18 standard premerge checks passed. The focused suite had 143 passes and four hard-lease command-template failures. All four fail at the same assertion on the current main baseline as well.
  • The packed DSH plugin with the signed full CLI was exercised in an isolated DSH 0.2.0-rc.2 Web profile on both File and SQLite. Each run completed one selected Turn and three recovery Turns, then registered the 30-minute Driver recheck with zero quota debits.

Prior-Turn recovery rebuilds the scheduler hint when the unchanged admission limit is reached. Forward the CLI detail selector to that projection so the DSH Driver receives the bounded recheck cadence it requested.

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 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 · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审提交 2a2740368658bed7d255660cabf6144286595993,对照目标主干 918809bb96b9c5ec4fe4fbc7651efd5dee2a5b10。

动机 / Motivation

在本地 Driver 上接续未结算 Turn、显式请求调度详情的宿主操作者。 目标主干在三次无进展恢复后正确进入 owner wait。重建 scheduler_hint 时丢失显式详情,DSH Driver 读不到本地重查间隔。 Driver 读不到本地调度对象时只进入等待,无法登记其本该使用的定时重查。 同一 File 或 SQLite 启一个原 Todo/Turn,让三次恢复没有新回执,再分别读取默认 guard、带 --include-detail scheduler 的 guard 和同一等待回执的重放。 候选在两库恢复了 30 分钟重查和 3 次不变上限。默认请求仍为 compact,详情开关下 reset token 相同,原恢复 effect 和等待回执保持相同,业务派发被阻止,扣额为零。 复验使用实际 Core CLI、File/SQLite 和合成待结算对象。实际 DSH 安装态与远程 authority 部署待验。

改动思路 / Approach

恢复原等待路径显式请求的 scheduler 详情,沿用 TypeScript 恢复判定、原 Turn 和已有宿主调度。 让两种 prior-Turn recovery 调用把现有 detail 布尔值送入同一个 scheduler builder,继续使用原等待判定和计数。 已绑定的同轮收尾继续从原 receipt 接续。该路径的 TypeScript verdict 不进入 attention 后的 scheduler 重建分支。

具体改动 / Changes

目标主干 918809bb96b9c5ec4fe4fbc7651efd5dee2a5b10 的 docs/quota-allocation.md 确定 scheduler-detail-opt-in 和 bounded-owner-wait 两项。显式请求才返回 runtime details,主路径保留 compact reset 和不变上限。等待重放仍绑定原回执,扣额规则沿原 owner。 调度契约 公开详情入口

三个文件新增 20 行、删除 6 行。两处配线已有 selector,恢复投影复用原 builder,File/SQLite 回归覆盖普通与显式详情的等待路径。

关键代码讲解

  • build_live_quota_should_run_decision 和 remote wait 入口把原详情选项带入同一个 prior-Turn 恢复 helper。正常 admitted 和已结算回执路径沿原裁决。 本地入口 远程等待入口
  • _apply_recovery_projection 在 TypeScript 恢复状态为 attention_required 时重建 scheduler_hint。现有 builder 按原调用方选择返回或省略详情。 恢复投影 hint 重建
  • DSH schedulerWait 读取 local_scheduler 的间隔和 unchanged_poll 上限。两库恢复的示例序列是 30、60、120 分钟。 Driver 读取

对主干的风险 / Risks

  • 相同八项恢复选择用例在目标主干均因缺少 cold_path_detail 失败。当前提交的 14 项恢复用例通过,覆盖 File、SQLite、owner 和 controller 的恢复区别。
  • 两库用实际 generic_cli guard 复验 Driver 参数组合,保持原 effect、同一等待回执和零扣额。紧凑请求仍无详情,显式请求得到 30 分钟间隔。Quick premerge 的 6 个直接和 3 个选定检查通过,提交含 DCO。
  • 本次核对真实 CLI 输出与 Driver 源码消费路径。安装态 DSH 的 timer 注册与远端 authority 部署另行核验。

我的整体评价 / Verdict

批准当前代码。已有等待原因、准入和回执保持稳定,显式请求详情时宿主重新得到重查间隔。复验使用实际 Core CLI、File/SQLite 和合成待结算对象。实际 DSH 安装态与远程 authority 部署待验。

English verdict: APPROVE. Restore requested scheduler details during recovery waits while preserving the compact default, original identity and zero spend.

Reuse observed host cadence and persisted backoff when projecting a prior-Turn recovery wait. Preserve the registered scheduler scope and place CLI options after the standalone interpreter prefix so the matched host can be acknowledged using the original receipt.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent loopx-agent changed the title fix(quota): keep requested scheduler details in recovery waits Preserve scheduler reconciliation during recovery waits Nov 16, 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 · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审提交 c28bccb2256c9caa754307b7ab3e6079e14548ef,主干对照 59e68906d4082f43fae52e4219e374c5e97539a9,PR merge base 6b2b40a7b81bf73ead86ef865aaed497f79db9b7。

动机 / Motivation

在 Core CLI、Codex App 或本地 Driver 接续未结算 Turn 的宿主操作者。
三次恢复没有新进展后,主干会进入等待,但丢失重查间隔和已观测的 App 规则。即使当前规则已经是 30 分钟,旧 guard 也会提出改写。独立 Core wheel 发出的 ACK 还会被 Python 拒绝。
用同一 File 或 SQLite 夹具完成三次无进展的恢复,然后读取 30 分钟等待。执行 guard 实际生成的 ACK,再重放同一等待,最后让合成宿主的规则漂移。
新提交恢复了 30 分钟重查。规则已经匹配时只发确认,确认后重放同一等待无需再次操作。规则漂移时产生更新提示,过期确认和缺回执的命令均被拒绝,复验全程零扣额。
独立复验使用隔离的 Core wheel、真实 File/SQLite 和合成宿主配置。受管 Codex App、实际 DSH 安装和远程服务端未在本轮独立复验。

改动思路 / Approach

沿同一个 scheduler owner 传递等待详情、当前观测 RRULE 和已确认的 backoff。小范围修复需要让投影使用原输入,也要让独立 Core 生成的命令可以原样执行。
恢复等待复用既有 scheduler 投影和 App 状态读取,输出绑定原 registry、runtime 和 Turn 的确认、失败和重查信息。

具体改动 / Changes

完整差异为 6 个文件,新增 190 行、删除 30 行。相对上一轮的 2a2740368658bed7d255660cabf6144286595993,本轮复验新增的 App 状态、远程绑定恢复路径以及 standalone launcher。主干 59e68906d4082f43fae52e4219e374c5e97539a9 中的 docs/quota-allocation.md 规定 local-recheck、matching-rule-ack 和 receipt-bound-followup 所对应的既有行为。 调度契约

关键代码讲解

  • apply_unsettled_host_turn_recovery_if_required。只有原恢复进入 attention_required 时重新投影。沿原裁决保留三次上限及零扣额,不把恢复提示当成新的执行许可。 恢复分流
  • build_live_quota_should_run_decision 与 project_recovery_scheduler_hint。普通读取沿已读的 App 状态,已配置远程的本地恢复用现有 scoped 状态和 Agent 身份。 本地 远程配置
  • bind_scheduler_followup_cli_routes。把全局参数放在 -I -m loopx.entrypoint 后,维持原 registry、runtime 及 Turn。 参数绑定

对主干的风险 / Risks

  • 两库各跑本地和切换远程配置后的恢复,共四组隔离 wheel。主干没有显式 30 分钟详情,两个本地 ACK 都被 Python 拒绝,远程配置路径无 ACK。新提交四组均执行了原样生成的 ACK 和失败记录命令。错误 RRULE 与无等待回执都被拒绝,宿主文件逐字保持,首次确认后重放原等待,未再次要求操作。
  • generic_cli 的 File/SQLite 都复验了显式 30 分钟、30/60/120 分钟序列和三次不变上限。省略 detail 时仍为紧凑视图,reset token 和原回执相符。源码恢复与调度测试 33 项通过,另取调度与结算相关用例两端各 21 项通过。Quick premerge 六个直接和三个选定检查通过,DCO 读回。作者另报更大用例组的四个 hard-lease 模板失败,本轮没有把这四项计入通过。

我的整体评价 / Verdict

批准当前提交。本地与配置为远程的恢复路径都复用原 scheduler 判定和原待结算身份,两个实际生成的跟进命令已通过独立 Core wheel 复验。 独立复验使用隔离的 Core wheel、真实 File/SQLite 和合成宿主配置。受管 Codex App、实际 DSH 安装和远程服务端未在本轮独立复验。

English verdict: APPROVE. Exact-head installed Core runs verified receipt-bound ACK and failure commands, drift handling and zero-spend recovery.

@loopx-agent
loopx-agent merged commit d22a497 into main Nov 16, 2026
42 of 50 checks passed
@loopx-agent
loopx-agent deleted the codex/preserve-recovery-scheduler-detail-20261116 branch November 16, 2026 08:34
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.

1 participant