Skip to content

Use composed C1 settlement for receipt-bound recovery - #9030

Merged
loopx-agent merged 1 commit into
mainfrom
codex/c1-bound-recovery-settlement-20261118
Nov 18, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/c1-bound-recovery-settlement-20261118

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

C1 recovery

An admitted Turn can still owe durable writeback when its Todo completes, is archived, or enters an external wait. In these cases quota should-run was still publishing a separate agent-owned spend command. The current recovery plan now uses the existing composed settlement owner and returns one command for validated writeback and the same Turn's runtime-owned debit.

The TypeScript recovery decision keeps the original Todo and Turn binding. The quota adapter publishes the same command through inline JSON and captured native context. When only spend is owed, the existing exact-identity recovery command repairs that step. A pending wait keeps its status and recovery grants no new delivery.

C1 caller cutover and recovery requirements

Validation

  • At baseline 4a0188c1ca1b, the focused CLI cases for both recovery routes return quota_settlement_plan_v1 and fail the new composed-plan assertion. At ab0b884f5d94, the 25 targeted CLI cases passed, including different Todo selection refusal, archived Todo recovery and external wait state.
  • Installed a standalone Core wheel in a disposable environment. Its actual CLI recovered each route on File and SQLite through the native capture reader. The returned command completed validation, writeback and debit under the original effect. Repeating the command returned the original receipts with a single writeback and debit. A File fixture with a missing debit receipt recovered through the owed action without charging again.
  • 108 focused TypeScript tests, TypeScript typecheck, changed-file Ruff and configured mypy passed. The exact-scope quality receipt is valid.
  • Standard premerge reported two failures reproduced on the baseline. The quota-plan smoke cannot import its sibling fixture under safe-path mode, and passed on both revisions with the fixture directory on the import path. The Todo read-model smoke reports an existing reverse import in quota/live_decision.py. All six direct checks passed.
  • The supplemental run passed 288 Python cases. Sixteen module-route cases selected the inherited installed launcher on this host, including representative baseline reproductions. All 41 program-route cases and all five TypeScript Python-discovery cases passed after clearing the inherited release variables. Two unrelated SQLite stress cases timed out during the broad TypeScript run.

The evidence covers the CLI and isolated Core lifecycle. C1 installed App adoption and matched real-model outcome and full-cost comparison still need their own acceptance evidence.

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.2-sol · OpenAI (runtime_reported, max)

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

动机 / Motivation

Codex App 和 CLI 需要恢复已有验证回执的原 Turn。Todo 完成、归档或进入外部等待后,仍欠写回的原 Turn 原先暴露两条分别由 Agent 执行的动作。同一命令一次完成原写回和 runtime 扣额,重试返回原回执,Todo 的外部等待保持可读。安装版 App 采用和真实模型完整成本仍有独立验收。

改动思路 / Approach

现有 TypeScript owner 继续判定原回执对应的恢复状态。Python adapter 复用现有 C1 结算计划,仅对 durable_writeback 生成一条由 runtime 收尾的命令。已有 writeback 只欠扣额时仍走原有恢复分支。

具体改动 / Changes

精确 head ab0b884f5d947f8d9be1e732a2511707accae8c1,diff base 4a0188c1ca1b6e33a11a7e31ddb56315bc1cdd46,4 个文件 +40/-46。逐项复核 original_binding、composed_recovery、idempotent_replay。验收约定

关键代码讲解

  • 完成、归档和外部等待仍以相同的原执行回执判定恢复资格。源码
  • 恢复只发一条 refresh-state,v2 计划把扣额交给同一 runtime。源码
  • 原命令重跑返回同一组回执。换 Todo 触发 identity conflict。源码
  • 外部等待的状态保留,完成恢复后原 Turn 变成 settled。源码

对主干的风险 / Risks

精确 head 的 20 个 File/SQLite CLI 用例和 116 个 TypeScript 用例通过。两组 CLI 在 base 的 20 个输入均实际返回 v1。指定源码导入路径后,两边 quota plan smoke 均通过。Todo read-model smoke 在两边均报告 live_decision.py 的相同逆向导入,预检仍有这条既有阻塞。本地聚合重跑另有子检查超时。

语义与 CI 对齐

只欠扣额的路径复用原分支,本次已核对差异及精确身份。已安装 App 和真实模型完整成本保留在后续验收。

我的整体评价 / Verdict

原结算身份、等待状态和已完成回执可读回。回归输入验证此次切换只生成一条结算动作,重复提交保持一次写回和一次扣额。批准当前精确 head。

English verdict: APPROVE. Receipt-bound recovery now issues one composed command for the original effect across completion, archive and external wait. The File and SQLite runs preserve once-only settlement.

@loopx-agent
loopx-agent merged commit 355b50b into main Nov 18, 2026
21 of 48 checks passed
@loopx-agent
loopx-agent deleted the codex/c1-bound-recovery-settlement-20261118 branch November 18, 2026 16:55
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