Conversation
Signed-off-by: Lihua <1017343802@qq.com>
Signed-off-by: Lihua <1017343802@qq.com>
Signed-off-by: Lihua <1017343802@qq.com>
Signed-off-by: Lihua <1017343802@qq.com>
|
Thank you for the concrete reproduction and File/SQLite coverage. The canonical fix has now merged via #4335 as main b0f7aa0, and #4327 is closed. Before closing this duplicate, I ran your exact tests/control_plane/test_explicit_successor_selection.py against that merged main: 7/7 passed, including legacy/File/SQLite, the long waiting chain, deterministic retry/no duplicate receipt, and canonical add-after-guard behavior. Merging both implementations would now create a second CLI selection transport beside the existing TS qualification + quota wrapper owner. Closing as superseded, not as a rejection of the contribution: your reproduction and provider matrix materially strengthened the accepted boundary and post-merge verification. |
|
Thank you for the clarification and for crediting the reproduction/provider coverage. I agree that the full #4332 transport should not be merged alongside #4335. I independently checked the remaining delta in an isolated checkout pinned to merged main
The guarded early return in Could we retain this as a small follow-up on the merged implementation—keeping its inventory/TS owner and workspace-repair behavior, and adding only final scope-guard qualification plus the focused regression? No need to reopen or merge the full duplicate PR. |
|
嗯,感觉 sol 搞错了,这个我 reopen |
|
我处理下吧 |
huangruiteng
left a comment
There was a problem hiding this comment.
动机
评审对象是 exact head 4332@df1c6889485cfffef5ecebfcfb01b5a30e0ccc96。PR 的目标是修复显式 --todo-id 在 replan、workspace 或 write-scope 最终 guard 之后被误报为 heartbeat_receipt_identity_conflict 的问题。这个问题仍有真实增量:在当前 origin/main@0933d48efc058d9e1585bd30058942416aa258a9 上,Todo 在首轮 guard 之后新增、随后要求 loopx/** 写范围时,focused fixture 仍返回 quota_unexpected_collection_error,没有保留类型化资格。旧 PR 的测试在它自己的旧基线通过,但整个 seven-file diff 已与当前 main 的 #4335 运行时/协议 transport 重叠。
改动思路
入口是 quota should-run --codex-app --todo-id,资格的语义 owner 是 TypeScript action-selection reducer,should_run_packet.py 组装最终 delivery route,quota.py 负责 CLI 诊断与 heartbeat receipt。旧 PR 中 _resolve_agent_lane_delivery_route 的 final-guard ordering 修复是有价值的;但是新增 quota_action_selection.py、新的 action_selection 字段、协议文档和大批 monitor/retry 测试,与当前 main 已有的 _apply_requested_quota_action_selection_preflight、action_selection_qualification 和现有回执测试形成第二套 transport。rebase 到当前 main 时 quota.py 与 settlement 测试发生冲突,确认了这不是一个适合整批合入的增量。
正向路径应是:先从 canonical agent Todo inventory 得到 qualification,再冻结 selected identity 并返回最终 workspace/scope guard;deferred/rejected 只返回 typed diagnostic,已有 identity-less receipt 只 replay,不写新 settlement identity、不扣额度。最小修复是保留现有 owner,只移动 qualification 计算位置并加入一条 late-selection boundary regression。
具体改动
关键代码讲解
loopx/control_plane/quota/should_run_packet.py::_resolve_agent_lane_delivery_route(约 549 行):旧 main 在 guarded-agent-lane 分支直接 return,跳过qualify_action_selection_from_inventory。PR 的最后一个 commit 将资格计算移到该 return 之前,保证control_repair/delivery_not_allowed仍能以 derivedaction_selection_qualification输出,同时不改变 selected Todo identity。loopx/cli_commands/quota.py::_apply_requested_quota_action_selection_preflight(约 390 行):当前 main 已是 CLI/receipt transport owner,负责把 deferred/rejected 转成quota_action_selection_deferred/rejected、回放现有 receipt 并阻止 settlement。旧 PR 新增的 parallel helper 与action_selection字段不应再保留。loopx/control_plane/work_items/action_portfolio.py::qualify_action_selection_from_inventory(约 134 行):继续作为 inventory-to-TS qualification adapter;没有新增状态源或 authority。tests/control_plane/test_explicit_successor_selection.py的 monitor cases 与tests/control_plane/test_quota_settlement_cli.py现有 guard cases 大量重复。真正缺少的是 late Todo + final boundary guard 的 canonical File fixture,应合并进现有 quota settlement suite。
对主干的风险
旧 exact head 直接合并会带来一个 P1 阻塞:它在当前 main 上是 stale/conflicting,并行引入第二个 explicit-selection transport,造成 action_selection 与 action_selection_qualification 两种公开字段和两套 retry owner;后续消费者可能把同一 deferred state 分流成不同错误码。该 batch 的 +522/-85 规模相对于当前只缺一个 ordering branch 是 disproportionate。
已验证的负向场景是:当前 main 的 early return 会让 late selection 退化为 quota_unexpected_collection_error;同一 real CLI/File-authority fixture 在把 qualification 前移后返回 quota_action_selection_deferred、reason=control_repair,现有 identity-less receipt 为 replayed 且 rollout event 数量不变。default/unselected、workspace repair、newly-due monitor、autonomous replan 和 user-gate 邻近场景均保持通过。没有新增 Todo authority、持久化 schema、quota spend、provider 或 capability activation。
请求修复(P1):将本 PR 收敛为现有 should_run_packet.py owner 中的 final-guard ordering 修复和一条 focused regression;删除/不合入已由当前 main 提供的 parallel CLI module、旧协议重复说明及重复 monitor 测试。对应回归为 tests/control_plane/test_quota_settlement_cli.py::test_selection_added_after_pending_guard_reports_final_boundary。
验证:旧 exact head 的 test_explicit_successor_selection.py 为 7 passed;当前 main 的 focused reproduction 在修复前复现错误码;收敛后的 two-commit patch 的 focused + 邻近 5 cases、完整 test_quota_settlement_cli.py(58 passed)、boundary/CLI suites(25 passed)及 Ruff/diff checks 通过。loopx canary premerge --from-git-diff 的 direct checks 和大多数 smokes 通过;quota-plan-smoke 在基线与修复分支均受 capability-memory effect-runtime fixture 失败影响,catalog-run-e2e-smoke 用项目 Python 直接运行通过但被 canary wrapper 报失败。这两项属于环境/基线证据,不是本 diff 引入的回归;应以推送后的 GitHub CI 为最终门禁。
我的整体评价
当前 #4332 exact head 不能合并,结论是 REQUEST_CHANGES。它包含一个正确且仍有价值的 final-guard ordering 修复,但其余改动在当前 main 上主要是重复实现/重复覆盖。收敛后的实现保持 TS qualification、Python quota transport 和 heartbeat receipt 的单一 owner,并以最小 real-path regression 锁定之前未覆盖的 boundary 分支。完成收敛、推送新 exact head 后应重新 review,不能继承本次结论或旧的 CI 通过状态。
English verdict: REQUEST_CHANGES for 4332@df1c6889485cfffef5ecebfcfb01b5a30e0ccc96. The final-guard qualification ordering is a valid incremental fix, but the seven-file head duplicates current main’s quota transport and exposes a second selection field/owner. Keep the existing TS/Python owners, retain the focused late-boundary regression, and drop the superseded module/docs/duplicate tests. Baseline reproduction shows quota_unexpected_collection_error; the focused repair returns typed quota_action_selection_deferred without receipt mutation.
Self-refined follow-up to #4332. Preserves existing TS/Python selection and receipt owners, fixes final-guard qualification ordering, and adds a real CLI regression. Local focused/full quota checks and all required GitHub checks passed; canary environment gaps are documented in the PR review.
Summary
An explicit Todo request could be refused by a replan, workspace or write-scope gate, then reported as
heartbeat_receipt_identity_conflicteven when the Turn had no settlement identity. Preserve the TypeScript qualification result and returnquota_action_selection_rejectedorquota_action_selection_deferred, with deterministic guard re-entry and no receipt creation, upgrade or quota spend.Recompute qualification after final workspace/scope guards while preserving their selected identity. Normal admitted selection, exact due-monitor obligations and committed-identity conflict rules remain unchanged. Failed preflight under
--turn-enveloperetains its typed packet and complete re-entry command.中文:修复显式 Todo 选择把真实准入阻塞误报为回执身份冲突的问题。保留 replan、工作树、写入范围、能力和认领边界;最终 guard 改变准入时重新计算类型化资格,返回原 Goal/Agent/Turn 的重入路径,失败不写或升级回执、不扣额度。
Issue Or Task
projection_staleor change the current-frontier admission policy.Validation
df1c6889485cfffef5ecebfcfb01b5a30e0ccc96.test_explicit_successor_selection.pyfails on immutable main7eb4b7bb1661bd5eff63a8725a33169792d5964bfor both canonical long-chain and add-after-guard cases, returning the old identity-conflict code. Both pass on the candidate.testspackage initially shadowed the repository namespace; the managed test passed with imports explicitly scoped to repository tests.Coverage and gaps: no store implementation, provider routing, promotion, score, persisted Todo schema or default capability change. PostgreSQL integration is not applicable to this CLI diagnostic/qualification projection change; File/SQLite are the reproduced entrypoints. A distinct case with an actually admitted default candidate and unavailable explicit source would need its own minimal fixture. No active Goal data or model/benchmark jobs were used.
Future-facing pass: moved existing explicit-selection validation/confirmation together with failed-preflight recovery into
quota_action_selection.py; the main command handler passes the existing complexity ratchet. The TypeScript qualifier remains the semantic owner. #4061's fallback-source work is unchanged.Frontend / Visual Evidence
--turn-envelopeoutput. No setting, frontend control or configuration projection changes; managed Turn keeps the shared eligibility owner.Type of Change
LoopX Area
Technical Direction
main.Shared-authority RFC fixture impact
N/A: this PR does not claim a provider migration or shared-authority promotion stage.
Boundary Checklist