Repository navigation
fix(matrix): preserve approval reactions after Gateway failures - #129879
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 12:58 AM ET / 04:58 UTC. ClawSweeper reviewWhat this changesPropagates transient Gateway approval failures from Matrix reaction handling and adds a regression test that preserves the approval anchor for replay. Merge readinessKeep open. Current main still treats a non-expired Gateway error as a successfully handled Matrix reaction, which commits the inbound replay claim; this PR propagates that error so the existing handler releases the claim. No blocking patch defect found. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherMatrix reaction events enter the Matrix channel handler, which claims an inbound event for replay protection and resolves authorized approval reactions through the Gateway. Successful or terminal resolutions retire approval anchors; transient failures must leave both the anchor and inbound claim available for recovery. flowchart LR
A[Matrix approval reaction] --> B[Inbound replay claim]
B --> C[Authorize reaction sender]
C --> D[Gateway approval resolution]
D -->|resolved or expired| E[Retire approval anchor]
D -->|transient failure| F[Release replay claim]
F --> G[Retry same approval reaction]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +46. Total +46 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep transient Gateway errors on the failure path so the Matrix handler releases its replay claim while the approval anchor remains available for an authorized retry. Do we have a high-confidence way to reproduce the issue? Yes—current main's non-terminal error return, the caller's subsequent commit, and the outer handler's release-on-error path establish a high-confidence source reproduction. Is this the best way to solve the issue? Yes—the smallest correct repair is to propagate the existing Gateway error to the inbound replay owner; retaining a success return would preserve the lost-action behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 33c88afc6dbe. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
… errors
Transient Gateway 5xx/network/auth errors in approval reaction resolution
were returning {handled:true, stopPolling:true}, which caused the durable
ingress while(true) loop to commit the claim (GUID tombstone) and lose
the operator's approval click permanently.
Fix: return {handled:false} so the loop retries via
iMessageApprovalControlBindings.wait(), keeping the durable claim alive.
This is the same fix pattern as matrix (openclaw#129879) and signal (openclaw#130134).
Test: prove transient errors keep the binding alive and return handled:false.
Fixes: imessage approval reaction silent drop on resolver-error
What Problem This Solves
Fixes an issue where Matrix users approving an execution or plugin request with a reaction would see no outcome when the Gateway temporarily failed, and the same approval reaction could not be replayed after recovery.
Why This Change Was Made
The Matrix approval reaction owner treated non-terminal Gateway errors as successfully consumed reactions. That caused the inbound owner to commit its durable replay claim even though the approval never resolved. Propagating the original error lets the existing inbound owner report it and release the uncommitted claim, while retaining the original approval anchor for an authorized replay. Sender authorization, reviewer identity, approval authority, terminal cleanup, and expired-approval behavior remain unchanged. Production delta: +1/-1 (net zero).
User Impact
Operators can recover a Matrix approval reaction after a temporary Gateway outage instead of losing the action silently and waiting for the approval to expire.
Evidence
gateway 503error; after the fix, the error propagates, the exact account/room/event approval anchor remains registered, and replay resolves the same approval and retires its anchor.git diff --checkall passed.