Skip to content

Show prior-Turn recovery waits in the DSH GoalBar - #8859

Closed
loopx-agent wants to merge 4 commits into
mainfrom
codex/dsh-recovery-attention
Closed

loopx-agent wants to merge 4 commits into
mainfrom
codex/dsh-recovery-attention

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

DSH could finish an automatic Host Turn before selecting its required Todo. The next scheduler evaluation created a fresh Turn, so the same omission could repeatedly spend model time. The previous PR head did this five times on File and SQLite before the fixture limit.

The new Driver reads the committed guard for the original Turn after the Host records completion of an entered step. If selection is still owed, it gives that Turn one automatic retry. A second completion with selection still owed waits and shows Prior turn needs recovery. A committed selection permits ordinary continuation. An explicit Pause and Start retries the same original Turn. Related to #8563.

Author Declaration

  • Written by model_agent, OpenAI Codex, GPT-6 family.

Implemented against

Criterion Disposition Owning path Validation
Read the exact persisted admission without creating a new one implemented quota receipt reuses the effective heartbeat receipt reader File and SQLite missing, unbound, bound, other-agent and byte-for-byte log readback
Count a normal native completion over an automatic message with required selection implemented DSH Session events and the original guard marker Packaged DSH on File and SQLite, plus restored events, wrong-Agent and no-step cases
Retry the original ID once, then surface the verified wait implemented Existing Driver and GoalBar read/watch Paired native exhausted/selection-success cases and the real GoalBar
Continue the previously selected recovery path implemented Core's existing recovery decision and GoalBar read/watch Packaged DSH on File and SQLite reached the original typed Core wait after three recovery admissions

The marker is written only on a positive guard that explicitly requires selection. DSH queries the scoped receipt only after it observes a completed step-bearing attempt carrying that marker. Older guard replies can omit the marker. The bounded retry is reconstructed from the same Session's typed history. Active execution and owner Pause retain their existing status precedence.

Scope And Continuation

The preselection limit counts completed Host attempts for one original Turn. The already-bound recovery path uses Core's admission allowance from #8577. #8563 also tracks durable Host attempt accounting for that bound path. The scheduler recheck repair is in #8851. The final head composes with #8851 and #8857. A merge simulation with #8856 reports a conflict in the adjacent Driver maintenance block.

Validation

  • Tested revision a0667f20cf54f5703bcce2d300d37dc9ab7db9aa
  • Compared previous PR head f8d21bdfaab0a42a2e691fec5a66b74e0cf16498 on the preselection path
  • Local run finished with synthetic input, DSH 0.2.1-rc.2 Web and the ordinary LoopX CLI from the signed checkout
Check Result Evidence
Native regression and real backends passed Previous plugin ran five distinct automatic Turn IDs before the fixture cap. Candidate exhausted cases on File and SQLite completed two Host attempts under one ID and showed the recovery wait. In two matched recovery cases, the second attempt bound the original Todo before DSH requested a fresh Turn.
Owner recovery passed In the real SQLite Web UI, Pause showed Paused. Start ran the third attempt under the same original ID and bound the Todo. The fixture exercised a later bound recovery limit. All arms recorded zero quota debits during these probes.
Bound path passed On both File and SQLite, the same package completed one selected Turn and three recovery Turns before the typed Core wait.
Core coverage passed Sixteen focused Python cases, Ruff and the exact receipt readback.
Plugin and premerge passed Plugin typecheck, full suite (309), peer/transport, package and runtime checks. Standard premerge passed six direct checks including Python compilation, plus 19 selected executions. The signed head rebuilt the same DSH tarball byte-for-byte.
Hosted CI and independent review pending Follow the new exact-head checks and review.

The DSH route requires the ordinary CLI's thread resolver. The standalone Core wheel was built and contained the changed receipt sources. Its DSH binding command is unavailable, so the native comparison used the ordinary CLI. All hosts and data here were isolated. Installed upgrade adoption is still pending.

Frontend / Visual Evidence

The final package's SQLite case shows the actual first viewport after two completed attempts with selection still owed. The recovery status is visible beside the existing Pause control on desktop and narrow views.

First viewport Packaged DSH at a0667f20cf
Desktop, 1200 px Original DSH Turn waiting for Todo selection on desktop
Narrow, 390 px Original DSH Turn waiting for Todo selection on narrow viewport
Previously selected Turn comparison on the earlier scoped package

The File fixture compares main f599a60ce6 with f8d21bdfaa. They show Active and Prior turn needs recovery respectively at the same Core hold.

First viewport Main Earlier PR package
Desktop Main GoalBar showing Active Candidate GoalBar showing Prior turn needs recovery
Narrow Main GoalBar on a narrow viewport Candidate recovery status on a narrow viewport

Type Of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Control plane
  • Host or runtime integration

Boundary Checklist

  • The diff, description and attachments contain public-safe source and synthetic evidence.
  • The scope is original-Turn recovery in the normal DSH Session.
  • The bilingual RFC diff check passed.
  • The first-screen comparison is attached above.
  • The commits have DCO sign-offs.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
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

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

评审提交 a0667f20cf54f5703bcce2d300d37dc9ab7db9aa,对照目标主干 f599a60ce64fd78db80d6318c84e3af58bfc1df9。当前头增加了未选择 Todo 时的原 Turn 接续和 quota receipt。在初始等待和这一新增场景中,后续 heartbeat 读取失败均会让恢复提示停在旧状态。

动机 / Motivation

已经启用 DSH Driver 的当前会话用户。用户要识别为何停住、修复或恢复后确认这条等待已解除。
主干在同一会话等待修复时仍显示“已激活”。
原轮触发 Core typed hold,或同一个原轮两次完成但仍欠选择。GoalBar 应展示当前会话的恢复等待,再在核验原回执或新 quota 决定后读回当前状态。
同一绑定的 Core hold 和原轮选择等待都能进入提示。原回执完成选择后可重新评价后续工作,但后续正文失败时界面仍投影之前的等待。
两项故障由实际 Driver 和合成 CLI 响应独立复现。当前头的打包 DSH smoke 与 File/SQLite 回执读回独立通过。未在安装或真实模型会话复现错误界面,托管 CI 未查询。

改动思路 / Approach

同一条提交栈在原 GoalBar 等待提示上增加 quota receipt 和短限额的同一原 Turn 选择恢复。read/watch 通过既有来源 revision 联动,原回执读回无写入。
复用现有 read/watch 和来源 revision 的设计适合这条渲染改动,但更新读取的事实绑到了较晚的正文成功分支,当前状态会失真。
loopx quota receipt 读原 Goal/Agent/Turn,跨 Agent 的回执不会被当前会话采用。Driver 折叠已完成且进入模型步的原选择,等待或沿原 Turn 继续。状态保留在原 GoalBar 行,Pause/Running 优先。提示解除应从 guard/receipt 已确认的事实生成。

具体改动 / Changes

19 个文件新增 488 行、删除 22 行。按 docs/development/design.md 核对以下要求。 原契约

  • typed-recovery-display。在相同绑定中显示 Core 的恢复等待并保持 Run/Pause 优先。 本轮实际入口对照通过。
  • latest-verified-quota-decision。下一次验证通过的 quota 决定应更新恢复提示,包含后续正文读取失败。 本轮复现下述缺口。
  • session-source-watch。状态通过现有 watch 通知当前绑定,区分会话,无新定时机制。 本轮实际入口对照通过。
  • original-unbound-recovery。原轮未选择时从原回执恢复,完成选择后恢复原调度。 本轮实际入口对照通过。

关键代码讲解

  • buildPlan。先核 Core 回执,然后读取 heartbeat task。恢复提示的事实在前一步已经产生。 按提交核对
  • evaluate。在计划完整返回后刷新本地提示。新反例固定在后续正文读取失败。 按提交核对
  • watchSourceRevision。同一次绑定在 read 和 watch 使用一致的状态 revision。 按提交核对
  • visibleStatus。恢复标记与 Pause/Running 同处现有位置。 按提交核对
  • foldSelectionEvent。在有原选择标记的续跑且模型已进入、Host 正常完成时累计同一原轮。 按提交核对
  • read_quota_receipt。从精确 Goal/Agent/Turn 读原已提交 guard。读回绑定后,Driver 可评估后续轮次。 按提交核对

对主干的风险 / Risks

  • [P2] 新轮已准入时仍显示旧恢复提示 先出现已验证的 attention_required,再由 Core 放行新一轮。另一个路径是两次完成后仍欠选择,随后精确 receipt 读回已选 Todo。两个路径在最新决定通过校验后注入 heartbeat-prompt 读取失败。 evaluate 只在 buildPlan 完整返回后更新 recoveryAttention。无论新 quota 决定已通过校验,还是 quota receipt 已确认选择,后续正文错误均提前返回,保留旧标志。 在当前提交的两个 Driver 反例中,已通过有效的 quota 决定。第二个反例还核验了原回执已绑定并转向 fresh Turn。正文失败后都没有排队新工作,hasRecoveryAttention 仍返回 true。 在当前绑定通过现有 Session 与取消检查后,使用已经验证的原选择回执和 quota 决定刷新提示。只有排队才依赖后续 heartbeat 正文。 原恢复等待问题
  • 独立通过候选插件类型检查及 309 项套件,主干套件 299 项。真实 File/SQLite 上新增 quota receipt 的两项读回用例通过,覆盖原 guard、选择后的同一 Turn、错误 Agent、无写入和零扣额。隔离 DSH 0.2.1-rc.2 打包运行 smoke 通过,使用合成 CLI。
  • Quick premerge 四项直接检查、三项 canary 和公开边界扫描通过。单签署提交绑定同一目标基线,git diff --check 通过。

语义与 CI 对齐

typed hold、暂停优先级和现有 watch 的正常路径正确。heartbeat-prompt 失败仍让旧 hold 显示,和已核验的最新 Core 决定不一致。托管 CI 未使用。

我的整体评价 / Verdict

请求修改。让恢复提示随已核验的 Core 决定和原选择回执刷新,再复验两类正文读取失败。PR 正文仍标记 f8d21bd,请在更新后随当前提交补齐覆盖范围。已逐张查看 PR 所附 1200 px 与 390 px 合成会话截图。连续会话消息可见,在输入框上方原行读到恢复状态和暂停按钮。窄屏将暂停按钮放到下一行,状态文字完整。没有新增展开项,截图只覆盖静态等待,未覆盖 heartbeat 失败或已安装升级。 无新增展开项。独立查看的是原 PR 静态截图,未安装真实连接或以浏览器复现正文错误。 桌面候选 窄屏候选

English verdict: REQUEST_CHANGES on a0667f20cf54f5703bcce2d300d37dc9ab7db9aa. On a0667f2, the GoalBar retains a cleared recovery hold when the following heartbeat payload fails. This reproduces after both a verified Core admission and a verified original selection receipt. Update the projection at the verified decision boundary.


// A cancelled maintenance result does not describe the current Session.
if (!admissionSignal?.aborted && this.ready(state) && state.agent.session === session) {
state.recoveryAttention = plan.kind === 'wait' ? plan.recoveryAttention : undefined

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.

[P2] 新轮已准入时仍显示旧恢复提示 先出现已验证的 attention_required,再由 Core 放行新一轮。另一个路径是两次完成后仍欠选择,随后精确 receipt 读回已选 Todo。两个路径在最新决定通过校验后注入 heartbeat-prompt 读取失败。 evaluate 只在 buildPlan 完整返回后更新 recoveryAttention。无论新 quota 决定已通过校验,还是 quota receipt 已确认选择,后续正文错误均提前返回,保留旧标志。 在当前提交的两个 Driver 反例中,已通过有效的 quota 决定。第二个反例还核验了原回执已绑定并转向 fresh Turn。正文失败后都没有排队新工作,hasRecoveryAttention 仍返回 true。 在当前绑定通过现有 Session 与取消检查后,使用已经验证的原选择回执和 quota 决定刷新提示。只有排队才依赖后续 heartbeat 正文。 原恢复等待问题

@mergify

mergify Bot commented Nov 16, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 16, 2026
@loopx-agent

Copy link
Copy Markdown
Collaborator Author

Closing this superseded branch cleanly: all commits from PR #8859 were integrated into PR #8879 (squash-merged onto main in 3d6fd2e0ce6cd82384b866f9aeaa377397701851) and independently verified at origin/main f15c705623 with LoopX 2.4.0 and dsh-loopx-plugin 0.1.1-beta.7 (quality, package, runtime DSH 0.2.2-rc.3, loopx-turn-dsh-e2e-smoke.py, loopx-turn-dsh-builtin-host-e2e-smoke.py, and 411 Python DSH/recovery tests passing). Follow-up pause/recovery regression lock-in is tracked in PR #8955. (This PR branch was superseded rather than directly merged.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Mergify: the pull request has merge conflicts with its base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant