Repository navigation
Use composed C1 settlement for receipt-bound recovery - #9030
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
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.
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-runwas 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
4a0188c1ca1b, the focused CLI cases for both recovery routes returnquota_settlement_plan_v1and fail the new composed-plan assertion. Atab0b884f5d94, the 25 targeted CLI cases passed, including different Todo selection refusal, archived Todo recovery and external wait state.quota/live_decision.py. All six direct checks passed.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.