Repository navigation
Stop repeated receipt prompts after a managed claim is declined - #9293
Conversation
…gence Layer 1 folds redundant coordination.write_scope and cba.active_write_scope entries using quota.write_scope_coverage semantic proof (preserving exact directory grants like plans alongside plans/**, external/credential boundaries, and --harden compatibility) and moves cba.active_write_scope off page-0 first read into on-demand context-read. Layer 2 stops projecting required_write_scopes into agent_todo_summary, selected_todo, capability_gate, and action_portfolio by default, disables required_write_scope_missing_from_goal_boundary repair when Goal covers repo root or task_repository is bound, and preserves raw Todo write contracts for delivery workspace causality, workspace_guard isolation, and selectedWorkLaunchBasis launch drift checks. Layer 3 stops collecting/checking per-path write_scope_conflict blocks across task_lease_acquire, adaptive_children, coordination, and todo_branch_plan while returning leases to Todo ownership + same-workspace locking, retiring thin claim overlap advisories, and reclaiming page-0 truncation glue. 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
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
[P2] 首次写入范围冲突提示要说明什么条件解除后才能重试
同一合格 worktree 内,两项 Todo 的写入范围相交。File 和 SQLite 都报告 write_scope_conflict,候选却只提示等阻塞条件变化,随后静默。 Host 查的是没有生产者的 workspace_lease_conflict,实际 owner 返回 write_scope_conflict。复用现有 write_scope_conflict。提示等待原冲突租约释放或到期;只有可隔离代码写入才提示选择已获授权的独立 worktree。用同 checkout 与独立 checkout 对照,并保留共享状态的原保护。 Host 映射 租约决定
动机 / Motivation
在 Codex 原会话自动认领 Todo、与其他 Agent 共用执行环境的使用者。 一个 Agent 在选中任务之后才发现其他 Agent 已先认领。基线把明确拒绝当成回执丢失,后续工具反复要求查找不存在的原回执。 候选在 File 和 SQLite 上只报告一次权威拒绝,同次 capture 再读保持安静。新 guard 能准备另一项工作,原 peer 租约和配额保持不变。 本次核对源码 CLI、隔离提供者和本地 hook。没有更改租约规则,未跑正式安装或付费模型。
首次也是唯一一次的消息需要给出实际写入范围冲突的恢复条件。
改动思路 / Approach
保留协调 owner 的拒绝分类,由 Host 提示并保存一次拒绝状态。 维持拒绝和未知提交的分流,补齐实际写入范围冲突的重试条件。 TypeScript 继续决定是否能变更 Todo 和租约。Python 只有在 provider、原操作和四项身份一致且不带原回执时,才记录明确拒绝。超时、来源错误和已存在回执仍能读回原操作。
具体改动 / Changes
关键代码讲解
完整评审 8027ab0,基线 217e59e,6 文件 +165/-24。原 docs/architecture/rfcs/composable-state-machines-recovery-verification-v0.md 的 Invariants 要求未知提交读原操作;Detection, containment and recovery evidence 要求恢复基于当前有效条件。前者通过独立核对;后者的提示缺口见 P2。 基线 RFC
- rejectClaim 在实际非预览的 pre-commit 拒绝上附带 Goal、Todo、Agent 和 claim operation。原租约和 provider 持久状态仍由既有判定控制。 拒绝 producer
- _run_json 按原来源与身份消费明确拒绝。同一 capture 的 native_execution_preparation_request 保存 rejected,后续相同入口可静默;另一合格 capture 仍能开始常规认领。 Host journal
对主干的风险 / Risks
语义与 CI 对齐
FAIL。同一已授权 worktree 内用原准入和原生 hook 复现,两种 provider 都返回写入冲突与当前 holder,原租约读回不变。基线仍反复提示查回执;候选一次拒绝后静默,实际用的是无条件细节的通用文案。 原租约没有被篡改,缺口在本轮唯一一次的恢复提示。代码写入是否适用独立 worktree,仍由当前准入决定。该情况与已通过的同 Todo owner 争用不同。
PASS。Python 原生准备 98 项通过。租约、原认领与转交 41 项通过。Node 协调状态和投影 59 项通过。标准 premerge 的 6 项直接和 18 项选中检查零失败。 另做实际 File/SQLite 普通竞态、同 capture 再读、原回执不存在、下一项 ready 和旧 capture 只读对照。错操作、身份来源未验证、已存在 receipt 仍保留恢复。当前头与核对时主干三方合成无冲突;本轮没有独立执行正式 Codex App 或 PostgreSQL。
我的整体评价 / Verdict
保留定证拒绝只报告一次和其他工作继续的改进。让重试提示引用现有 scope code 与可验证条件,再复跑完整原生冲突路径。核对了原生 quota hook、普通认领和文本提示,改动未涉及应用页面渲染。
English verdict: REQUEST_CHANGES at 8027ab0. The native Host misses the canonical write_scope_conflict code, so its only refusal notice lacks the actionable retry condition on File and SQLite.
…traction-20261122 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>
…naged-claim-scope-followthrough Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…ions Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…naged-claim-scope-followthrough 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-astra · OpenAI · runtime_reported · xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
在 Codex 会话内由宿主自动认领 Todo 的 Agent。 选中 Todo 后另一名 Agent 先取得租约,旧宿主把明确拒绝当作回执可能丢失。 File 和 SQLite 的下一次工具调用都安静;首次拒绝指出持有人、解除条件及可继续的工作。 本次评审覆盖本地宿主和协调层。未衡量模型是否一定采纳重试建议。
改动思路 / Approach
协调层唯一决定认领状态,宿主只负责把已知结果与不确定结果呈现给调用方。 改动限于原认领操作的拒绝分类、恢复提示及同一捕获的生命周期。 用户授权、租约持有者和当前工作区可用性分别取证。下一次能够执行的操作取决于原有权威状态;只读文本、过期执行证明或恢复建议都不会扩大可执行范围。
具体改动 / Changes
| 调用位置 | 此提交的行为 |
|---|---|
| rejectClaim | 将权威拒绝和 operation 身份返回给本地宿主 |
| _run_json | 校验来源、schema、状态和完整操作身份,给出重试条件 |
| native_execution_preparation_request | 相同捕获的终局拒绝只报告一次,新捕获独立准备 |
核对条目 Invariants 与 Detection, containment and recovery evidence。File/SQLite 真实 hook 与活动同工作区租约产生明确拒绝,继续提示独立工作,下一次 hook 静默。 不匹配的 operation、既有回执或未获证明的 provider 继续查原操作;确认的 workspace_lease_conflict 只报告一次。 对照用例从正常入口操作隔离的实际提供者,保留操作前后的状态与可见诊断。 验收依据,a4e0d384868c3ec6587df49dcc784679b2301f02
对主干的风险 / Risks
旧头真实 write_scope_conflict 只给通用条件;修正后说明 lease 释放或到期。 旧 provider 的路径冲突说明租约释放或到期;当前工作区冲突也允许可隔离的工作换到授权工作区。新行为只针对提交前已经确定拒绝的原操作。未获完整证明或已有历史回执的结果继续查原操作。主分支最容易出现的回归是把缺少有效身份当成授权,或在遭遇并发后反复要求用户干预。同工作区冲突在 File 和 SQLite 的真实 Codex hook 均报告一次,后续工具调用静默。7 项定向测试通过,涵盖错误 operation、未验证 provider、已有回执及新 guard 继续工作。首次并行负载测试中 File 的新 guard 曾返回待恢复,单独重测通过。真实 PostgreSQL 集成 400 项全部通过,标准 premerge 选中 18 项全部通过,当前 main 合并基准的补丁与测试时逐字节相同,RFC 成对检查通过。 历史回执与新的执行机会分别按原身份处理。未把按策略跳过的远端 CI 或未运行的正式模型当作验收证据。
我的整体评价 / Verdict
精确提交 16a71e64f77703c80f30addab7d41a43b3d3af0d 的评审包含 6 files, +188/-24。协调层唯一决定认领状态,宿主只负责把已知结果与不确定结果呈现给调用方。 操作者可以从真实拒绝原因和有效租约判断下一步,独立任务可以继续推进。后续安装版本是否包含该改动需要单独读回,离线评审结果也不等于真实用户的长期收益。
English verdict: APPROVE. The reviewed head satisfies the scoped ownership and recovery contract under the tested local providers.
Why this matters
An agent can lose a race between selecting a Todo and claiming it. The native host handled a definitive refusal like a lost reply. Later tool calls kept asking the agent to find a receipt for a claim the provider had already declined.
Observable behavior
The first refusal identifies the Todo, the reason, the holder when available, and the condition for trying again. Later tool calls and another presentation of the same capture stay quiet. A fresh guard can prepare a different eligible Todo immediately in the same session.
The coordination owner supplies its existing decision with the identities of the Goal, Todo, actor and claim operation. The host records the refusal only when those identities match and the provider confirms a pre-commit decision. A timeout, a mismatched response, or an existing receipt retains the recovery path for the original operation. The extra state is local to native host preparation; lease admission stays with its current owner.
Verification
29def33edc. Two independent validation Todos with overlapping declared paths could be claimed on File and SQLite while the peer lease kept its original version. Sibling worktree admission and same-checkout collision cases passed. refactor(control-plane): apply 3-layer write_scope subtraction convergence #9256 owns the write-scope policy.The packaged run used disposable local state. Rollback is a revert of this change; no authority data migration is required.