Repository navigation
fix(feishu): wait for reply settlement in replay test - #159168
Conversation
|
🦞👀 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: blocked before merge. Reviewed September 26, 2026, 4:58 PM ET / 20:58 UTC. ClawSweeper reviewWhat this changesThe Feishu rich-post replay test waits for reply delivery to settle after durable ingress drains and before checking reply counts. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 2 items remain Keep open. Current main still has the replay-test race, and the proposed wait follows the fixture’s reply-settlement promise. The reported validation has not yet met OpenClaw’s documented flake-proof run counts. Priority: P3 Review scores
Verification
How this fits togetherFeishu’s monitor accepts events into a durable ingress queue, filters replays, and dispatches accepted turns to the reply path. This test sends rich-post events through that path and checks which replies are delivered. flowchart LR
A[Feishu rich-post event] --> B[Durable ingress queue]
B --> C[Replay adoption]
C --> D[Reply dispatcher]
D --> E[Reply settlement]
E --> F[Replay test assertions]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +2. Total +2 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the replay regression at the Feishu transport boundary with assertions synchronized to reply settlement, then document the required repeat-run results. Do we have a high-confidence way to reproduce the issue? Yes. The PR reports a controlled deferred-adoption probe that produced the exact failing assertion on main and passed with the wait; source inspection supports that ordering, though this read-only review did not execute the probe. Is this the best way to solve the issue? Yes. Waiting on the fixture’s owned reply-settlement promises addresses the assertion race without weakening replay assertions or changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 19c6ef8d9e02. 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
|
|
Publication handoff: exact-head CI is green for The underlying review completed in ClawSweeper run 36270386859, job 108483092577, but its publication step at 20:46:21 UTC hit The publication owner needs to recover that completed review's application, after which the prepared native merge operation can resume. No duplicate review, gate bypass, or test rerun has been requested. The failed operation's lock was safely recovered. |
Related: #159128
What Problem This Solves
Fixes an intermittent Feishu rich-post replay test failure where reply counts are asserted before an adopted turn finishes delivery.
User Impact
No user-visible behavior changes. The existing transport replay regression keeps its original assertions while waiting for its owned reply work to settle.
Why This Change Was Made
An empty ingress queue proves durable adoption, but adoption completes before logical replay commits and reply delivery. The fixture now awaits the existing reply-dispatcher completion promises after draining ingress, so delivery assertions and monitor teardown cannot race those replies.
Evidence
The failure on #159128 was
expected [1, 0] to deeply equal [1, 1]inmonitor.post-replay.test.ts. The same test and original 16-file, 308-test shard passed without changes on both that PR head and main. The sender-retired diagnostics in the failed job came from earlier tests, not the failing replay assertion.A temporary deferred-adoption probe on main
915e37b7ddcbf884a78cb650e9463bfa9f0000e9reproduced the exact[1, 0]failure by allowing the queue to drain before the second reply continued. The same schedule passed with this completion wait. The probe was removed from the final change; no sleeps, retries, timeout increases, weaker assertions, or production test seams were added.The final fixture passed the original 16-file shard: 308 tests, 59.58 seconds wall time. The one-worker cost command
pnpm test extensions/feishu/src/monitor.post-replay.test.ts --maxWorkers=1passed in 29.31 seconds wall time, with 24.32 seconds Vitest duration and 2.068 seconds test-body time. Hosted CI passed at the exact repair head: extension test job, 1.226 seconds test-body time, 38.67 seconds Vitest duration, and 96 seconds total job time including setup.Changed-file validation (
node scripts/check-changed.mjs -- extensions/feishu/src/monitor.post-replay.test.ts) passed, including extension-test types, targeted lint/formatting, and repository guards. Independent Codex review was clean through P2.