Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
68f6e1a to
dbec031
Compare
|
Codex review: blocked before merge. Reviewed September 2, 2026, 9:28 PM ET / September 3, 2026, 01:28 UTC. ClawSweeper reviewWhat this changesThe PR carries a per-approval lifecycle instance from the Gateway through channel and UI controls so an old control for a reused approval ID cannot resolve its replacement. Merge readiness⛔ Blocked before merge - 7 items remain Authority-chain proof required: the Gateway-side lifecycle validation is coherent, but this conflicting branch still lacks real Telegram evidence that a stale authorized callback cannot resolve a replacement approval. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway creates approval requests and channels or UI clients present them as controls. When a control is submitted, the Gateway decides whether it still refers to the live approval before applying a decision. flowchart LR
A[Approval request] --> B[Gateway approval manager]
B --> C[Lifecycle-bound record]
C --> D[Channel and UI controls]
D --> E[Resolution request]
E --> F[Gateway lifecycle check]
F --> G[Resolve or reject]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase cleanly, retain the Gateway as the final lifecycle authority, and provide a redacted Telegram Test Server trace showing stale rejection before resolution, an actionable replacement, and successful matching resolution. Do we have a high-confidence way to reproduce the issue? Yes, from source: create an approval, replace it under the same ID, then submit the old lifecycle-bound control; the Gateway should reject it before resolution. This review did not execute that scenario. Is this the best way to solve the issue? Yes: propagating the instance and checking it at the Gateway final decision owner prevents stale controls from resolving a replacement while preserving the intentional tokenless legacy route. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2d9796d66c43. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (21 earlier review cycles; latest 8 shown)
|
f7fd886 to
05a6425
Compare
05a6425 to
8d929b8
Compare
8d929b8 to
d096e80
Compare
d096e80 to
00ee922
Compare
|
Rebased onto current Preserved both current-main approval UI/E2E coverage and this PR's same-ID generation guard. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
00ee922 to
087d52f
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Closing as superseded on current main. Operator approvals now persist a unique opaque resolution reference and resolve through the durable first-answer-wins store/CAS path across channel and UI consumers. That canonical locator already rejects stale controls after lifecycle replacement without carrying the old optional instance field through 100+ clients. Canonical owner stack includes #103579, #104837, and #117095. |
Related: #114492 (intentional focused split; the source PR is otherwise untouched)
What Problem This Solves
Fixes an issue where an older approval control could decide a newer approval after an ID was reused. The same race could also remove a replacement approval from the Control UI or attach the older decision's error to it.
Why This Change Was Made
The Gateway now mints a unique lifecycle instance for every approval and validates it at the final resolution owner. That instance is carried through protocol events, durable presentation state, typed actions, first-party apps, the SDK, MCP/ACP/TUI/CLI clients, and Discord, Slack, Telegram, and iMessage controls. Portable reaction/card bindings now carry the same lifecycle instance through Signal, WhatsApp, Matrix, Google Chat, and Teams to the final Gateway resolver. The Control UI separately reconciles an awaited decision only with the exact approval generation it captured.
The protocol addition is backward compatible: controls that carry an instance fail closed when the ID now names another lifecycle, while shipped tokenless clients retain their existing ID-based route. Existing ID-only resolution-reference digests are unchanged.
User Impact
Approval controls now authorize only the prompt that created them. Reused-ID replacements remain visible and actionable, stale channel buttons/reactions cannot decide a newer request, and matching current controls continue to resolve normally across first-party surfaces.
Evidence
ca90c248889901294858ebd11a30fd45da273517preserved the owner-bound patch. The rebased main still resolved approvals by reusable ID alone insrc/gateway/exec-approval-manager.ts,src/gateway/server-methods/approval-shared.ts, the unified protocol schemas, andui/src/app/overlays.ts;src/gateway/operator-approval-store.tsintentionally expires terminal rows, so later ID reuse is a supported lifecycle state. Subsequent live-main churn throughee0d376e0fe976691ea6985357577949bd4def85changed 56 paths with zero overlap against this PR.approval.getremainedpending, then verified the matching control resolved toallowed/allow-once. Testboxtbx_01m155kj14xgkp7kyjrrd9dtvs, 1/1 passed, wrapper exit 0: https://github.com/openclaw/openclaw/actions/runs/33214239355node scripts/run-vitest.mjs ui/src/app/overlays.approval-replacement.test.ts, 5/5 passed. Coverage includes success, ordinary failure, stale/expired failure, and distinct generations with the same timestamp.tbx_01m1583yj5cn8av75gt9ytfj13, wrapper exit 0: https://github.com/openclaw/openclaw/actions/runs/33217279661tbx_01m155y8d4kxwj7xwctx5t2kq1, wrapper exit 0: https://github.com/openclaw/openclaw/actions/runs/33214662789tbx_01m157z5fz7pa3m88yphzrxrhb(https://github.com/openclaw/openclaw/actions/runs/33217113233), andui/src/components/sidebar-attention.test.tspassed 35/35 on Testboxtbx_01m158a0r6eprarzs7r034e4xd(https://github.com/openclaw/openclaw/actions/runs/33217494937).instanceId; 15 siblings passed. Testboxtbx_01m158x887b2cr837s2xr7x5kn: https://github.com/openclaw/openclaw/actions/runs/33218135966tbx_01m159t7dhs4sfpfzd7knc9p4j: https://github.com/openclaw/openclaw/actions/runs/33219079064tbx_01m159dgx8zn1nap8mqe7z9ksz(https://github.com/openclaw/openclaw/actions/runs/33218667430); final compressed Signal test prooftbx_01m15apng37ybnder4czxgwp3e(https://github.com/openclaw/openclaw/actions/runs/33220011101).old-instancewas absent on Testboxtbx_01m15bmvb92pvr56vz4evm5xww(https://github.com/openclaw/openclaw/actions/runs/33220935016). After forwardingrequest.instanceIdatbindPending, 23/23 native/downstream WhatsApp tests and extension production typecheck passed ontbx_01m15brqrhhgzesec2k66em3ay(https://github.com/openclaw/openclaw/actions/runs/33221053040); CI then exposed the generic optionalbindPendingmethod type; the narrow test-onlybindPending!correction passed a fresh non-incremental extension-test typecheck locally.patch is correct, confidence 0.99; thread01a04ac5-0321-72c2-afb2-722871673a1c).tbx_01m1adh3crka3ks89gfwmrsvny, 74/74 focused tests plus protocol check, wrapper exit 0: https://github.com/openclaw/openclaw/actions/runs/33339951810. Exact conflict-file formatting passed on Testboxtbx_01m1admrcx6jfd0bxd5ckr0bn2: https://github.com/openclaw/openclaw/actions/runs/33340042237. Fresh full-branch Autoreview reported no actionable findings.\n- Exact-head CI: attempt 2 passed every selected job, includingopenclaw/ci-gate, at head8300e46d4a5db58c4f847d60d94bde644bad6fe9: https://github.com/openclaw/openclaw/actions/runs/33340158264\n- Topology: range-diff preserves all 18 lifecycle commits from source headdb85299d89b88aa9dcc72f049ed85f2558ef1731. The mechanical recovery rebase moved prior head24e115e2e807cc5c7f6f13df72ce52e93842a826ontoca90c248889901294858ebd11a30fd45da273517; the current exact head is8300e46d4a5db58c4f847d60d94bde644bad6fe9.Visual proof shows the reused-ID replacement arriving, remaining actionable after the older decision fails, and resolving normally. Capture code and media are not committed.
Replacement arrives while the older same-ID decision is pending:
Replacement remains actionable after the older decision fails:
Replacement resolves normally: