Repository navigation
refactor: consolidate exact keyed async queues - #99691
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 3:06 PM ET / 19:06 UTC. Summary PR surface: Source -276, Tests -44. Total -320 across 30 files. Reproducibility: not applicable. this is an internal refactor rather than a bug report. The reviewable behavior is source-level equivalence with the existing keyed queue contract and the linked maintainer cleanup request. Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge after a maintainer confirms each migrated caller only needs keyed FIFO ordering, rejection recovery, unrelated-key parallelism, and final-tail cleanup on the final head. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal refactor rather than a bug report. The reviewable behavior is source-level equivalence with the existing keyed queue contract and the linked maintainer cleanup request. Is this the best way to solve the issue? Yes, with maintainer confirmation: the existing Plugin SDK helper is the narrowest shared solution for exact keyed FIFO queues, while specialized cancellation, debounce, single-flight, and drain/reset queues should remain local. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 614e87cce1d4. Label changesLabel justifications:
Evidence reviewedPR surface: Source -276, Tests -44. Total -320 across 30 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
7a1f0de to
05a3e7a
Compare
ee9de1d to
36bcbd9
Compare
36bcbd9 to
00abee4
Compare
|
have thoroughly reviewed the risk labels and don't think any prod behavior will change with this deduplication. |
* refactor: consolidate keyed async queues * chore: refresh merge-ref CI * refactor: encapsulate keyed queue ownership
Closes #99683
What Problem This Solves
OpenClaw carried repeated per-key promise-tail serializers across core and bundled plugins. Each copy independently implemented FIFO ordering, rejection recovery, unrelated-key parallelism, and final-tail cleanup, creating drift risk around the same concurrency invariant.
Why This Change Was Made
This migrates 23 exact-contract callers to the existing
enqueueKeyedTaskprimitive inopenclaw/plugin-sdk/keyed-async-queue. Caller-owned tail maps remain where drain, reset, or test behavior observes them.Timeout eviction, close cancellation, debounce replacement, single-flight caching, and hybrid owner scheduling remain local; the shared helper gains no new options or policy.
User Impact
No intended user-visible behavior change. Maintainers and plugin developers now have one tested implementation for exact per-key FIFO serialization, with 244 fewer production lines across the migrated slice.
Evidence
node scripts/run-vitest.mjs run --maxWorkers=8 <14 explicit files>: 438 tests passed across 13 shards.node scripts/run-vitest.mjs run --maxWorkers=8 <8 explicit files>: 246 tests passed across 7 shards.node scripts/run-vitest.mjs run extensions/imessage/src/monitor/catchup.test.ts: 26 tests passed after the type correction.tbx_01kwn3c71shq3s8nsbd4wkvn71:check:changedpassed core/extension typechecks, core/extension lint, repository guards, and runtime import-cycle checks. Actions run: https://github.com/openclaw/openclaw/actions/runs/28686960340.agents/skills/autoreview/scripts/autoreview --mode local --prompt-file /tmp/keyed-queue-review-notes.md --stream-engine-output: clean, no accepted/actionable findings, confidence 0.97.git diff --numstat origin/main...HEAD: 114 additions, 358 deletions, net-244lines across 23 production files.git diff --check origin/main...HEAD: passed.