Skip to content

Recover the original Chat Todo and Monitor confirmations - #8725

Open
loopx-agent wants to merge 16 commits into
mainfrom
codex/audit-chat-creation-receipt-pr-20261114
Open

loopx-agent wants to merge 16 commits into
mainfrom
codex/audit-chat-creation-receipt-pr-20261114

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

When Chat loses a confirmation request before it saves the first creation plan, reload can leave the original proposal stuck on Applying. Chat now offers the original retry once the action owner observes that its last holder has released the lock or exited. A live confirmation stays pending, and apply still takes the same lock before it checks the reviewed source.

Monitor previews now bind the reviewed store and provider revision. If the revision advances before the first write, the original request returns stale. Once a write has committed, retry recovers its original operation and receipt.

Validation

  • Built and served packaged Chat from af94fe6d0b against disposable File and SQLite. All 12 scenarios at 1200 and 390 pixels passed. The real Monitor HTTP endpoint returned 409 on File and SQLite after an independent write advanced the reviewed revision. Both stores kept their original rows.
  • 30 targeted Python tests, 28 targeted TypeScript tests, the full control plane type check, the bilingual RFC diff check and all 19 standard premerge checks passed at cbdc765548.
  • Use the selected Goal runtime for Chat task reads and writes #8717 still has a reported upstream assignment failure. A Todo can remain unassigned after an unrelated write advances the same Goal revision. The same case remains reproducible on this branch with File and SQLite. Independent review and the required integration evidence remain open. Upstream review

Review sequence remains #8717 → #8725 → #8727. All three target main.

Visual evidence

Packaged Chat with disposable Goal data. The desktop capture at 54c8d23b5c shows the disabled confirmation. The desktop and narrow captures at af94fe6d0b show the original retry after reload.

Desktop before Desktop after Narrow after
Interrupted confirmation remains disabled on reload Same interrupted confirmation can be retried Original confirmation on a narrow screen

确认中断后从原操作续做。Monitor 首写沿用审阅时的来源和修订。

Release browser check

The installed browser shard reaches the saved Goal workspace-selection case and times out on its old start-first-run assertion. The failure reproduces on packaged main and on the installed wheel from the #8725 run. With the test correction, the full typed-actions scenario passes in both local comparisons. Hosted verification of the correction is pending. Failed job Test correction

Use the serving coordination runtime for reviewed Todo and Monitor actions when no registered runtime owns the route. Keep the same provider for preview, apply and receipt replay, and retain registry precedence when a source is registered.

Signed-off-by: LoopX Agent <[email protected]>
Route reviewed Todo creation, assignment and Monitor creation through the same Goal source used for Task reads. Use the serving runtime only for an unbound project registry. A shared directory resolves its source registry before any write, and a Monitor confirmation becomes stale when that source registration changes.

Signed-off-by: LoopX Agent <[email protected]>
Persist the reviewed provider, source and operation before a create. On retry, the canonical writer recovers the original receipt before checking freshness for a new write. Monitor retries retain the first due time and concurrent callers share the saved request.

Signed-off-by: LoopX Agent <[email protected]>

@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)

评审提交 a00b3dc0e1161f2bcce4f5e626ddc2597338de9a,目标分支基线 3347c7f8dbb0a20cfe5bda7bfdbb69af69c1ef0c。

[P2] 打包 Chat 将已提交的确认导向新提案。 在打包 Chat 确认创建 Todo。让真实 provider 提交后,第一次保存 todo_created checkpoint 时抛出 I/O 错误。 页面显示「未写入」,唯一可见的重试先生成新 proposal,再要求确认。实测新确认返回 todo_already_exists 和另一份 receipt。原确认仍能经 HTTP 取回 todo_added 和原回执。 创建和 checkpoint 失败分支

动机 / Motivation

这项改动面向在 Chat 或飞书确认创建 Todo 或 Monitor,并需在中断后恢复原结果的用户。 在同一中断条件下,目标基线的原确认会被当前 provider revision 判成 stale。 页面显示「未写入」,唯一可见的重试先生成新 proposal,再要求确认。实测新确认返回 todo_already_exists 和另一份 receipt。原确认仍能经 HTTP 取回 todo_added 和原回执。 候选直接重试同一 HTTP 确认返回原始 Todo 和回执。File、SQLite 中均只保留一个 Todo,provider revision 保持不变。 实测使用合成 Goal、真实本机 Chat HTTP 和 File/SQLite;飞书走模拟确认,PostgreSQL integration 跳过。已安装 App、真实飞书及托管 CI 未验证。

改动思路 / Approach

现有 Todo provider 拥有提交和回执,ChatActionStore 持有原确认,Dashboard 负责展示该确认的真实状态和恢复动作。 先保存原确认的 provider revision、源注册表摘要和 operation ID,SQLite 与 File 的写路径仍用现有 CAS。已有回执时可以重新读取原操作。从当前 Goal 的持久提案和类型化原操作状态投影未知/待恢复结果,呈现同一 proposal 的重试。在已准备或已提交时保留其身份,并约束 regenerate,避免让现成恢复路径被新确认替代。 保存原确认

具体改动 / Changes

关键代码讲解

新增 v3 传入源摘要和原 provider revision。TypeScript 在新写入前检查来源及 revision,在已提交时先读原回执。HTTP 的通用错误响应随后仍把打包页面交给 apply_failed,可见按钮触发 regenerate。实测第二次确认只找到了已经创建的任务,同时给出另一个 proposal 和 receipt ID。回执、来源和 CAS 通用失败回传 界面重试

基线 docs/project-agent-todo-contract.md 的 原操作回执 和 新请求来源约束 已验证。Chat 原确认恢复 仍有上述反例。现有前端交付要求从普通入口走到错误恢复和读回。基线写入合同 前端验收路径

对主干的风险 / Risks

独立同条件下,基线回原提案得到 stale,候选 HTTP 能恢复原回执。页面第二次确认未重复写 Todo,仍让用户多确认一次且拿到不同的回执。当前 main 的合成检查还发现 local_authority_runtime.ts 冲突,需要基线集成后再验证。后续 #8727 只代表一个单独候选。

语义与 CI 对齐

28 项 Python、5 项 TypeScript 与 17 项 standard premerge 通过,另有一项 PostgreSQL 集成测试跳过。 模拟飞书确认和原生 HTTP 复读通过。当前实际展示缺口来自精确头的打包页面。

我的整体评价 / Verdict

请求修改。从当前 Goal 的持久提案和类型化原操作状态投影未知/待恢复结果,呈现同一 proposal 的重试。在已准备或已提交时保留其身份,并约束 regenerate,避免让现成恢复路径被新确认替代。 用同一个 File/SQLite 提交后故障,在打包 Chat 确认、刷新和重试原操作。断言原 proposal、Todo 和 receipt ID 一致、权威修订不变,且未提交的过期预览仍可重建。

1200 × 854 桌面和 390 × 854 窄屏均显示原任务和「未写入」,主按钮要求重新确认。窄屏按钮在首屏,两次明确确认才能得到另一个提案的结果。 实测使用合成 Goal、真实本机 Chat HTTP 和 File/SQLite;飞书走模拟确认,PostgreSQL integration 跳过。已安装 App、真实飞书及托管 CI 未验证。

English verdict: REQUEST_CHANGES at a00b3dc. An original HTTP retry recovers the committed receipt, but packaged Chat falsely reports no write and regenerates a different confirmation instead of exposing that retry.

Comment thread loopx/chat_actions.py Outdated
return self._create_confirmation_conflict(proposal, error)
todo_id = _opaque(canonical_receipt["todo_id"], field="todo_id")
self.store.save_checkpoint(
proposal = self.store.save_checkpoint(

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] 打包 Chat 将已提交的确认导向新提案。 在打包 Chat 确认创建 Todo。让真实 provider 提交后,第一次保存 todo_created checkpoint 时抛出 I/O 错误。 页面显示「未写入」,唯一可见的重试先生成新 proposal,再要求确认。实测新确认返回 todo_already_exists 和另一份 receipt。原确认仍能经 HTTP 取回 todo_added 和原回执。 从当前 Goal 的持久提案和类型化原操作状态投影未知/待恢复结果,呈现同一 proposal 的重试。在已准备或已提交时保留其身份,并约束 regenerate,避免让现成恢复路径被新确认替代。 用同一个 File/SQLite 提交后故障,在打包 Chat 确认、刷新和重试原操作。断言原 proposal、Todo 和 receipt ID 一致、权威修订不变,且未提交的过期预览仍可重建。

@huangruiteng
huangruiteng changed the base branch from codex/audit-chat-goal-routing-pr-20261114 to main November 14, 2026 12:18
@mergify

mergify Bot commented Nov 14, 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 14, 2026
Integrate the current Goal source routing. Prepare the exact Todo or Monitor operation before the authority write, bind recovery to the original store and registry, and show the saved confirmation after a reload. Validate recovery on the packaged workspace against File and SQLite.

Signed-off-by: LoopX Agent <[email protected]>
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 14, 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

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

评审提交 05007a8e6a62b3e37041151d4e1722a1ad606e5d。GitHub 目标基线为 58cc5817e35ea9a0dc4697f7791279c6d80946bc。

[P2] 创建确认在保存计划前失败后失去恢复入口。 在 Chat 确认创建 Todo,首次保存 todo_create_prepared 时发生一次 I/O 错误,尚未调用权威 Todo writer。 两种存储都没有写入 Todo。HTTP 对原确认的四个处置入口均返回 409,而原 apply 在故障消失后能创建一次。页面的 review plan 没有重试动作,刷新后待确认列表也排除了原确认。 仅在有准备记录时才提供重试

动机 / Motivation

在 Chat 中确认创建 Todo 或 Monitor 的使用者。 在 Goal 中确认创建 Todo 或 Monitor,短暂写入故障结束后应能找回原确认和结果。 已写入 Todo 或 Monitor 但丢失确认回执时,File 和 SQLite 均保留原确认,重试取回同一个 Todo 与回执,权威修订不再变化。 已验证本地打包 Chat、合成 Goal 和真实 File/SQLite。新反例来自实际 HTTP 与当前前端 selector,已安装 App、真机飞书和 PostgreSQL 端到端尚未核验。

改动思路 / Approach

Chat 保存确认计划,Canonical Todo owner 检查来源与 revision 后写一次。已提交时从原 operation 返回回执,页面需要让这个恢复路径可见。 让已确认但未准备成功的创建有可见的原操作重试。由现有 Chat action owner 统一标记可安全重试的状态,再让待确认列表和详情使用同一标记。继续保护任何可能已经写入的确认。 原确认交给 Canonical Todo owner

具体改动 / Changes

关键代码讲解

  • 先保存原 operation ID、registry 摘要和 store identity,再进入 Todo/Monitor 的真实 writer。两个存储在提交后丢回复都可找回同一回执。取消、推迟、拒绝和重新生成均被拦截,原操作续跑只读回已提交的结果。
  • 首次保存准备记录失败时,实际响应仍进入 canonical_action_failed。后端保护原确认,前端等待并不存在的准备记录。待确认列表只纳入可重试的失败项,所以刷新后找不到原卡。待确认列表的筛选
  • 差异含 33 个文件,+1,735/−292。大部分验证来自跨存储写入、回执和打包场景。独立确认逻辑放在现有 Chat Todo owner,后续分支继续复用它。

按现有 Todo 合同和前端交付要求核对。original-operation-replay、source-and-no-write 已验证,recoverable-confirmation-before-plan 未满足。原确认与来源约束 用户入口的恢复要求

对主干的风险 / Risks

在 GitHub 目标基线制造相同的写入前 I/O 中断,两个 provider 都保持原修订,HTTP 允许重新生成可确认的 preview。 影响范围是 Chat 已确认创建后的首个准备写失败。用户仍能看到当时错误,但刷新后会失去原确认的恢复入口。 在 HTTP 保存失败对象后,Python 保护通用失败状态;TypeScript 仅把已保存计划或已完成检查点投影为可恢复。 使用两个隔离存储,在首次保存确认计划和权威写入后分别注入一次故障,刷新确认抽屉,验证原动作可重试、来源变化仍被拒绝,原 Todo/Monitor 和回执在重复提交后保持一致。

语义与 CI 对齐

精确头的 110 项 Python、25 项 TypeScript(1 项跳过)、19 项预合并检查通过。后续 12 项打包 HTTP 测试通过。File 和 SQLite 的写前反例均可复现。 托管 CI 未查询。已合成检查与最新 main 的变化,代码结论绑定上述提交。

我的整体评价 / Verdict

请求修改。让已确认但未准备成功的创建有可见的原操作重试。由现有 Chat action owner 统一标记可安全重试的状态,再让待确认列表和详情使用同一标记。继续保护任何可能已经写入的确认。 打包 Chat 的 1200×854 桌面和 390×854 窄屏上,已保存确认的任务标题和「重试原操作」都在首屏。窄屏保留了原结果和返回入口。提前中断时,实际失败响应使当前页面把确认排除在列表外。 已验证本地打包 Chat、合成 Goal 和真实 File/SQLite。新反例来自实际 HTTP 与当前前端 selector,已安装 App、真机飞书和 PostgreSQL 端到端尚未核验。

English verdict: REQUEST_CHANGES. A transient failure before writing the create plan makes the original confirmation disappear after reload, even though retrying its original HTTP action succeeds. Keep that action visible while continuing to fence committed work.

}
// A confirmation with a saved create plan may already have written. Only a
// complete plan for this exact proposal can offer native recovery on reload.
if (todoCreation && ["failed", "applying"].includes(String(proposal.status))

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] 创建确认在保存计划前失败后失去恢复入口。 保存 todo_create_prepared 前的一次 I/O 故障在 File 和 SQLite 均复现。实际 HTTP 仍可重试原确认,但这个条件要求已有准备记录,导致页面隐藏恢复入口。请让两处共享原确认的可安全恢复判断,并保留已提交路径的四个拒绝。

@mergify

mergify Bot commented Nov 14, 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 14, 2026
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 15, 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

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

评审提交 7bdda5bfea4846cca5e7bb3b3caa5f8c6d75ee8a,目标基线 eaff94c7449c2fa3ce49edf3adc7e6258ccd8b0c,上一评审头 05007a8e6a62b3e37041151d4e1722a1ad606e5d。

[P2] 创建确认在保存计划前失败后失去恢复入口。 在 Chat 确认创建 Todo,首次保存 todo_create_prepared 时发生一次 I/O 错误,尚未调用权威 Todo writer。 File 和 SQLite 首次都没有写入 Todo。HTTP 取消、推迟、拒绝及重新生成均返回 409;原 apply 能创建一次。实际打包页面刷新后丢失原确认和重试入口。 重试要求已保存的计划

动机 / Motivation

在 Chat 中确认创建 Todo 或 Monitor 的使用者。 在 Goal Chat 中确认创建后,即使写入前中断也能找回原操作。 提交后的回执丢失在 File 和 SQLite 都可恢复原 Todo 或 Monitor。重试保留原任务、确认回执和 provider revision。 验证使用本地打包 Chat、合成 Goal、实际 File/SQLite;已安装 App、真实飞书和 PostgreSQL 端到端待核对。

改动思路 / Approach

Chat 保存确认计划,Canonical Todo owner 校验来源与 revision 后写一次。页面用现有 review plan 投影原操作的恢复或结果。 复用现有 Chat action owner 对原确认的安全重试判断,让待确认列表和详情都能提供它。可能已经写入的确认仍走原 operation。 原确认和计划的 owner

具体改动 / Changes

关键代码讲解

  • 原 proposal 冻结 operation ID、来源摘要与 store identity。Todo 和 Monitor 在权威写入后丢确认回执时,从原 ID 恢复,不增加一次 provider revision。
  • 写前失败仍会产生 retry_safe=true 的 canonical_action_failed。后端保护原确认,前端等待尚未保存的计划,待确认列表依赖 retryOriginal 收入失败项。待确认列表
  • 全 PR 有 33 文件,+1742/-297。上次评审之后,这 33 个路径中 27 个字节相同。其余涉及导航、确认详情、服务及 plan 编译。最新提交还移除了已核验结果里的闲置确认控件,写前恢复条件仍可复现。

original-operation-replay 和 source-and-no-write 已核对,recoverable-confirmation-before-plan 尚未满足。原确认和来源 前端任务恢复

对主干的风险 / Risks

在当前 GitHub 目标基线模拟写入前的相同故障,两种存储都保持原修订,重新生成可得 201 和待确认预览。 最新增量移除了已核验创建结果的一个失效按钮,同时叠加现有 Goal/会话导航更新。仍按旧条件决定写前恢复,并通过两个 provider 和实际页面重测。 使用原确认分别注入首次准备写入失败和提交后回执丢失,在真实 File/SQLite、打包桌面和窄屏刷新,断言原确认可恢复并只写一份。

语义与 CI 对齐

当前 110 项 Python 和 32 项 TypeScript 通过,另 1 项 PostgreSQL 跳过。标准 premerge 共执行 19 项,CLI 输出预算 smoke 超时,quota-plan smoke 因导入失败退出;补齐本地测试导入路径后,后者在相同基线和候选上单独运行均通过。 托管 CI 未查询。打包本地页面和直接 HTTP 给出一致的恢复缺口。

我的整体评价 / Verdict

请求修改。复用现有 Chat action owner 对原确认的安全重试判断,让待确认列表和详情都能提供它。可能已经写入的确认仍走原 operation。 1200×854 桌面和 390×854 窄屏完成加载后,正常待确认项仍显示;两处都找不到首次准备失败的原确认和重试按钮。 验证使用本地打包 Chat、合成 Goal、实际 File/SQLite;已安装 App、真实飞书和 PostgreSQL 端到端待核对。 在故障结束后,用户应能从原 Goal 对话找到并继续已有确认。

English verdict: REQUEST_CHANGES at 7bdda5b. The exact packaged Chat still hides an original confirmation after a transient prepare failure. Both providers can recover the original action via HTTP; expose that recovery in the original Chat view.

&& createPlan.preview_id === identity.sourceFingerprint
&& textValue(createPlan.source_identity) && textValue(createPlan.source_authority)
&& textValue(createPlan.expected_provider_revision) && textValue(createPlan.expected_registry_sha256)
&& textValue(createPlan.expected_store_identity)) {

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] 创建确认在保存计划前失败后失去恢复入口。 File/SQLite 的真实原 apply 可以安全恢复,桌面和窄屏的已加载列表却都缺原确认。让既有 action owner 的可安全恢复状态同时驱动列表和重试。

@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)

评审提交 54c8d23b5c3d22d28bd02cb4a746bc87ba331c0d;对照目标基线 b46a76d2d64b3c14877bdf288953c56ae1c7793b。

[P2] 首次保存准备记录前中断后,原确认无法恢复。 确认请求在保存首份创建计划和写入任务之前退出;前端刷新后只读回 applying,且没有 checkpoint 或失败结果。 桌面和窄屏的原卡都还在,抽屉只显示禁用的「正在应用」,没有重试。File/SQLite 两种存储都没有首写;同一 apply 能成功完成一次,第二次返回原回执。 对应代码

[P2] 首次计划丢失后,Monitor 重试使用未审阅的新修订。 Monitor 确认遇到首份计划保存错误,未写入;有人对同一 Goal 完成一次有效修改,provider revision 前进,来源注册表不变。 同一 Monitor 提案重试返回 200,用新的修订号保存计划并新增 Monitor;同条件的 Todo 返回 409,仍未写入。两个后端结果一致。 对应代码

动机 / Motivation

在 Goal 里从对话确认待办或定时检查(Monitor)的人。 提交待办或定时检查后,即使首次确认中断,也应能重新打开原确认并完成它。 以前确认中断后,提交人得自己核对后台有没有留下任务,避免重复创建。 要么只能等待,要么离开当前确认查询后台,核对是否已写入和是否会重复。 可捕获的准备写入错误保留原提案;未变更修订时只创建一次。写入已发生但回执丢失时,重试仍保留原 Todo/Monitor 和回执。 验证使用源码构建的打包 Chat、实际本机 HTTP 和隔离 File/SQLite;PostgreSQL 用例跳过,未验证装机 App、实际飞书租户或托管 CI。

改动思路 / Approach

以原提案 ID 找回操作。Hub 的 action store 保留确认和步骤,Goal 对应的 Todo 存储判定能否写入并生成回执,Dashboard 展示原记录和恢复入口。 复用现有操作锁和已经有来源绑定的 provider 写入。保留一个类型化恢复条件,并将阶段与原确认依据配对;不再建独立重试协议或让界面从错误文案推断写入。 服务判定恢复和初次写入权限;provider 拥有唯一写入和原回执;页面只展示原确认和读回结果。 先保存同一提案的准备信息,再交给已注册 Goal 的权威存储;已有原回执时按同一 ID 核验和更新展示。 首份计划和写入后的回执是两道不同的持久化边界;真实请求退出不会留下可捕获的错误记录。

具体改动 / Changes

关键代码讲解

apply;compileActionReviewPlan;_apply_monitor_create。原提案的锁会阻止仍在执行的同一次 apply;锁释放后,服务能够安全读回或重放。当前抽屉在首份记录缺失时要求先看到已经持久化的失败,遗漏了请求先退出的分支。Monitor 的动作指纹只有注册表和来源路径;记录尚未保存时,服务给它的计划写入了恢复时的存储版本,无法证明这个版本是操作者审阅过的。生产 24 文件,+749/-289;测试和夹具 8 文件,+1023/-9;其余为文档和工作流。

基线写入约束、打包任务验收及本提交的原确认约束:original-create-result 已验证;preplan-interruption-recovery 未满足;reviewed-monitor-revision 未满足。

对主干的风险 / Risks

首份计划和写入后的回执是两道不同的持久化边界;真实请求退出不会留下可捕获的错误记录。 桌面和窄屏的原卡都还在,抽屉只显示禁用的「正在应用」,没有重试。File/SQLite 两种存储都没有首写;同一 apply 能成功完成一次,第二次返回原回执。 同一 Monitor 提案重试返回 200,用新的修订号保存计划并新增 Monitor;同条件的 Todo 返回 409,仍未写入。两个后端结果一致。 由已有 action owner 区分仍有持锁请求和可恢复的原确认;为后者开放同一 apply,继续由原锁、来源和修订号把关,保留对取消和重新生成的限制。 在原 Monitor 确认依据中保留已审阅的修订号及存储见证,在首写前比较;有原提交回执时仍按原 operation ID 恢复,不让重试静默采用当前修订。 恢复权限只覆盖所选的原提案。服务须区分活请求、陈旧依据和可安全重试的原确认;有历史回执时沿用原结果。基线 HTTP 已能恢复 applying 提案,本轮缺口是被当前交付承诺覆盖的页面和未写 Monitor 的修订检查。

语义与 CI 对齐

PASS:82 项定向 Python、26 项定向 TypeScript、19 项标准 premerge(含 diff 与双语 RFC 检查)。 标准门首次因本机示例导入路径和临时目录位于私有树下失败,换用隔离的系统临时目录并保留示例导入路径后通过。全量类型检查在基线和候选的同一位置报 TS2345。 验证使用源码构建的打包 Chat、实际本机 HTTP 和隔离 File/SQLite;PostgreSQL 用例跳过,未验证装机 App、实际飞书租户或托管 CI。 旧 wire 的降级和缺见证对照仍由同一验证入口拒绝;原 Todo 修订过期后可重新审阅且不写任务。用打包 Chat/HTTP 在标为 applying 后、保存准备记录前中断请求,刷新后从原抽屉重试;核验只创建一次、返回同一回执,另设仍持锁和旧修订对照。 让首份 Monitor 计划写入报错,再通过另一项 Todo 写入推进修订,重试同一提案;断言原请求拒绝首写,且此前已提交的 Monitor 仍可读回原回执。

我的整体评价 / Verdict

请求修改。正常的已提交恢复能继续工作;请求退出前后仍有两处未满足的约束,持续恢复和页面可操作性都还未验收。桌面保留原卡,窄屏抽屉中长标题可完整换行;首份准备前的中断在两处都只显示禁用的「正在应用」。 优先修复共同的确认 owner,再重跑上述两个对照和原回执、浏览器恢复;沿用现有状态字段和权限边界。验证使用源码构建的打包 Chat、实际本机 HTTP 和隔离 File/SQLite;PostgreSQL 用例跳过,未验证装机 App、实际飞书租户或托管 CI。

English verdict: REQUEST_CHANGES at 54c8d23. A persisted applying confirmation can stay disabled after reload, and an unwritten Monitor can adopt an unreviewed revision on retry.

&& textValue(createPlan.expected_store_identity);
// The server may fail before any checkpoint is saved. The same apply still
// owns the reviewed source and must revalidate it before the first write.
const interruptedBeforePlan = createAttemptFailed && failure?.retry_safe === true && proposal.checkpoint == null

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] 首次保存准备记录前中断后,原确认无法恢复。 确认请求在保存首份创建计划和写入任务之前退出;前端刷新后只读回 applying,且没有 checkpoint 或失败结果。 桌面和窄屏的原卡都还在,抽屉只显示禁用的「正在应用」,没有重试。File/SQLite 两种存储都没有首写;同一 apply 能成功完成一次,第二次返回原回执。 由已有 action owner 区分仍有持锁请求和可恢复的原确认;为后者开放同一 apply,继续由原锁、来源和修订号把关,保留对取消和重新生成的限制。 用打包 Chat/HTTP 在标为 applying 后、保存准备记录前中断请求,刷新后从原抽屉重试;核验只创建一次、返回同一回执,另设仍持锁和旧修订对照。

def _monitor_create_fingerprint(source: ChatTodoSource) -> str:
from ..chat_actions import _digest

return _digest({

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] 首次计划丢失后,Monitor 重试使用未审阅的新修订。 Monitor 确认遇到首份计划保存错误,未写入;有人对同一 Goal 完成一次有效修改,provider revision 前进,来源注册表不变。 同一 Monitor 提案重试返回 200,用新的修订号保存计划并新增 Monitor;同条件的 Todo 返回 409,仍未写入。两个后端结果一致。 在原 Monitor 确认依据中保留已审阅的修订号及存储见证,在首写前比较;有原提交回执时仍按原 operation ID 恢复,不让重试静默采用当前修订。 让首份 Monitor 计划写入报错,再通过另一项 Todo 写入推进修订,重试同一提案;断言原请求拒绝首写,且此前已提交的 Monitor 仍可读回原回执。

@mergify

mergify Bot commented Nov 15, 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 15, 2026
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 15, 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

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

评审提交 af94fe6d0b9acdcc0375bd39149a8c5ad4fdd301,对照目标基线 cbdc7655482e3db8cc70c5b0c4e49451d902a360。

[P2] 无关提交后恢复已创建 Todo 的指派。 确认时选择了具体 Agent。Todo 已写入并保存 todo_created 回执,另一个请求随后写入同 Goal 的无关 Todo。 当前提交在两个后端首次 apply 和原提案 retry 均返回 HTTP 400,报告修订已变化。原 Todo 已持久化且未指派,用户重试时仍使用刚创建时的 Goal 修订。 指派的修订前置

动机 / Motivation

在 Chat 中确认创建并指派任务或设置 Monitor 的操作者。 两种恢复触发点包括首份创建计划之前的请求中断,以及创建落库和后续指派之间的独立 Todo 写入。 原确认在首份计划前失联时,基线刷新后仍卡在 Applying。修复了首份计划前中断后的恢复。打包 Chat 刷新后能从原卡片继续,File 与 SQLite 都只创建一次。无写入的 Monitor 在另一个写入推进修订后返回 409,保持原数据。 独立覆盖打包 Chat 的桌面路径、真实 HTTP 与隔离 File/SQLite。真实安装宿主和 PostgreSQL 集成不在本次证据范围。

改动思路 / Approach

Chat 执行者持有原 proposal 和创建 checkpoint,canonical Todo provider 管理修订、权限和回执。 复用已有原生 create、update、claim 和 source witness。分配继续用原操作身份,缺少有依据的目标冲突恢复。 当前恢复读取原 checkpoint 后复用其 creation receipt,再发出原指派操作。保留原创建和指派 operation id。遇到 Goal 修订推进时,在原 store 内确认同一创建回执和目标 Todo 的指派前置条件,再用原子校验继续指派;目标、归属或来源实质变化时返回可操作的冲突。

具体改动 / Changes

关键代码讲解

原确认的中断恢复已经核验。File 和 SQLite 的两种视口、三种中断位置共 12 个打包浏览器用例都回读了原提案和单条新增记录。确认持有者检查

Monitor 的首写修订已经核验。File 与 SQLite 的基线在其他 Todo 更新后仍创建 Monitor,候选在原审阅过期时返回 409,两个实际存储的行和修订均保持不变。Monitor 首写检查

创建后的指派恢复仍有反例。在精确目标基线,File 和 SQLite 两个完整 HTTP 入口都返回 200,原 Todo 保持一次创建并完成指派。 候选把创建时修订留在 checkpoint。每次重试都传同一旧值,无关 Todo 的提交令该指派始终被拒绝。指派调用 · 现有 Todo 写入契约

对主干的风险 / Risks

用户已确认指定 Agent,也已经有了可见任务。两个后端的原提案重试均没有新写入,目标任务仍未指派。无关 Todo 自己的写入保持有效。现有用例覆盖了来源替换与恢复原来源,仍要验证来源有效而同 Goal 修订已推进的情况。

语义与 CI 对齐

112 项 Python 检查、26 项 TypeScript 检查和本地 standard premerge 的 25 项执行通过。PostgreSQL 用例跳过。 对照试验只在原 Todo 创建和指派之间增加一次无关提交。直接检查通过覆盖不了这段顺序,目标及无关记录已经分别读回。

我的整体评价 / Verdict

请求修改。原确认的恢复和过时 Monitor 拒写已在当前提交复验。把原任务的指派恢复加到真实 HTTP 回归中,覆盖无关更新与目标或来源变化两种情况,并核对同一任务、同一操作及实际归属。1200 × 854 和 390 × 854 的打包 Chat 都能读全原任务标题。刷新后可找到原卡的重试入口,成功后显示原回执和查看更新后的 Goal。高级诊断保留在折叠区。 独立浏览器覆盖桌面和窄屏,实际安装宿主仍待验证。

English verdict: REQUEST_CHANGES at af94fe6. An unrelated Todo update leaves the original confirmed assignment permanently retrying a stale Goal revision.

agent_id=str(agent_id),
authority_reason="owner-confirmed typed Chat action",
update_operation_id=f"chat-assign:{proposal_id}",
update_expected_provider_revision=binding["provider_revision"],

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] 无关提交后恢复已创建 Todo 的指派。 确认时选择了具体 Agent。Todo 已写入并保存 todo_created 回执,另一个请求随后写入同 Goal 的无关 Todo。 File 和 SQLite 的基线都返回 200 并完成指派。候选首次提交和原提案重试都返回 400,原 Todo 已写入且没有归属。保留原创建和指派 operation id。遇到 Goal 修订推进时,在原 store 内确认同一创建回执和目标 Todo 的指派前置条件,再用原子校验继续指派;目标、归属或来源实质变化时返回可操作的冲突。

This branch has not been deployed

No deployments
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