Repository navigation
fix(x): stop removed allowlist senders from reaching dispatch or replies mid-authorization - #165244
Conversation
Let the allowlist store invalidate account-scoped authorization snapshots when an administrator changes stored grants. Recheck the snapshot before agent dispatch and immediately before every reply POST. Stale ingress retries against current policy; stale replies fail as non-retryable and not dispatched. Keep config refresh checks and durable ingress settlement with their owners. Prove removal during thread assembly, binding resolution, reply resolution, and final fetch handoff with controlled promises and fake timers. Verify that removed mentions complete once and unrelated accounts remain authorized. The pre-fix source fails the binding, reply, and final-fetch regressions. Validation: X suite, 71 tests across 9 files, 92.41s wall time. The final authority-suite rerun passed all 6 tests (264.81s wall, including the shared worker rebuild; 0.302s in reported test cases). No CI run was requested. Both extension typecheck lanes, typed oxlint on the 12 touched files, formatting, and whitespace checks pass. Codex autoreview is scoped-clean through P2 with no actionable findings.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 9:48 PM ET / October 5, 2026, 01:48 UTC (Revision 2). ClawSweeper reviewWhat this changesThe X channel invalidates in-flight sender authorization when administrators change stored allowlist grants and rechecks it before agent dispatch and each public reply request. Merge readiness✅ Ready for maintainer review This repair remains necessary: current main lacks the authorization fence. The pinned patch has no actionable correctness or security findings, consistent with the previous unchanged-head review. Priority: P2 Review scores
Verification
How this fits togetherThe X plugin turns allowlisted mentions into agent requests and posts answers as public replies. Its authorization checks connect administrator-managed sender permissions to inbound dispatch and outbound network requests. flowchart TD
A[X mention] --> B[Sender authorization]
C[Administrator allowlist changes] --> D[Account generation fence]
D --> B
B --> E[Agent dispatch]
E --> F[Reply authorization]
D --> F
F --> G[Public reply request]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +110, Tests +294. Total +404 across 12 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep allowlist mutation fencing with the existing store owner and synchronous authority checks at dispatch and reply boundaries. Do we have a high-confidence way to reproduce the issue? Yes, from source: remove a stored sender while asynchronous ingress resolution or reply authorization is suspended; current main retains the earlier allowlist result without a mutation fence. This review did not execute that scenario. Is this the best way to solve the issue? Yes. The patch repairs the existing allowlist owner and carries its current-authority guard to effect boundaries while preserving config policy and stored data contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5007d0ae3e47. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…165244) Let the allowlist store invalidate account-scoped authorization snapshots when an administrator changes stored grants. Recheck the snapshot before agent dispatch and immediately before every reply POST. Stale ingress retries against current policy; stale replies fail as non-retryable and not dispatched. Keep config refresh checks and durable ingress settlement with their owners. Prove removal during thread assembly, binding resolution, reply resolution, and final fetch handoff with controlled promises and fake timers. Verify that removed mentions complete once and unrelated accounts remain authorized. The pre-fix source fails the binding, reply, and final-fetch regressions. Validation: X suite, 71 tests across 9 files, 92.41s wall time. The final authority-suite rerun passed all 6 tests (264.81s wall, including the shared worker rebuild; 0.302s in reported test cases). No CI run was requested. Both extension typecheck lanes, typed oxlint on the 12 touched files, formatting, and whitespace checks pass. Codex autoreview is scoped-clean through P2 with no actionable findings.
Related: #165138
What Problem This Solves
Fixes removed X senders still reaching agent dispatch or receiving a public reply when an administrator removes them from the allowlist during asynchronous mention authorization, including thread assembly, binding re-resolution, or preparation of the reply POST. Found during the landing of #165138.
User Impact
Allowlist removals now take effect for in-flight mentions: stale authorization fails closed before dispatch and immediately before every reply POST. The ingress retry re-evaluates current policy and drops the mention once; other accounts remain unaffected.
Why This Change Was Made
The allowlist store owns an account-scoped generation fence that in-flight authorization checks at each dispatch and reply boundary. Configured
allowFromchanges continue to use the existing config re-read checks. This preserves the existing owners for policy, ingress retries, and durable settlement.Evidence
Validation recorded for commit
97105d4289e3d08965061b0d48d05265115963a3:pnpm test extensions/x --maxWorkers=1: 71 tests across 9 files passed; 92.41 seconds wall time.git diff --checkpassed.The native PR-head review checkout reran
pnpm test extensions/x --maxWorkers=1: all 71 tests across 9 files passed in 209.82 seconds wall time (207.32 seconds runner time; includes 71.401 seconds of fresh shared-worker preparation).Exact-head CI run 37251251519 passed, including
openclaw/ci-gate, in 459 seconds elapsed. Thechecks-node-changedjob used 118 seconds; these are job/run timings, not an isolated measurement of the six race cases. No CI reruns or flake retries were needed. ClawSweeper also completed review of this exact head with no actionable findings.No documentation or changelog edits; no screenshots because there is no UI change. The race proof uses controlled fixtures, not a live X account.