Skip to content

fix(feishu): wait for reply settlement in replay test - #159168

Merged
steipete merged 1 commit into
mainfrom
fix/l95-feishu-replay-settlement
Sep 26, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/l95-feishu-replay-settlement

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

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] in monitor.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 915e37b7ddcbf884a78cb650e9463bfa9f0000e9 reproduced 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=1 passed 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.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: XS labels Sep 26, 2026
@steipete
steipete marked this pull request as ready for review September 26, 2026 20:39
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 26, 2026, 4:58 PM ET / 20:58 UTC.

ClawSweeper review

What this changes

The Feishu rich-post replay test waits for reply delivery to settle after durable ingress drains and before checking reply counts.

Regression provenance

Possible 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
Reviewed head: 4b815568451d7d883c642f2ef37082397ee3e4fc

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The two-line test fix has a credible controlled reproduction and a clean exact-head check, with repeat-run flake proof still incomplete.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The repository state identifies this as a member-authored, test-only repair, so contributor real-setup proof is not required. The PR reports a controlled failure and after-fix pass through the Feishu monitor test, but repeat-run validation remains below repository policy; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository state identifies this as a member-authored, test-only repair, so contributor real-setup proof is not required. The PR reports a controlled failure and after-fix pass through the Feishu monitor test, but repeat-run validation remains below repository policy; no stored-data contract changes.
Evidence reviewed 8 items Introduced change: The pinned PR delta adds a wait for the reply-dispatcher mock’s returned promises after the queue checks, without changing production code or assertions.
Current-main behavior: Fetched main checks for an empty ingress queue and then asserts reply counts without waiting for reply settlement. The verified test merge adds only this PR’s two test lines.
Settlement contract: The lifecycle mock resolves its returned promise after the run, dispatcher idle wait, and settlement callback; the reply test runtime’s idle wait joins queued delivery promises.
Findings None None.
Security None None.

How this fits together

Feishu’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]
Loading

Before merge

  • Resolve merge risk (P1) - The PR reports a controlled before-and-after probe, but its reported clean-run counts remain below the repository’s 20 standalone and three original-shard flake-proof requirement.
  • Complete next step (P2) - Document the repository-required 20 clean standalone runs and three clean runs of the original shard before merge.
Agent review details

Security

None.

PR surface

Tests +2. Total +2 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 2 0 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 2 0 +2

Review metrics

Metric Value Why it matters
Reported flake validation 1 standalone run and 1 local original-shard run after the fix; policy calls for 20 and 3 The controlled probe supports the fix, while the documented repeat-run gate remains incomplete.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the replay regression at the Feishu transport boundary with assertions synchronized to reply settlement, then document the required repeat-run results.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a test-stability repair with no production or user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository state identifies this as a member-authored, test-only repair, so contributor real-setup proof is not required. The PR reports a controlled failure and after-fix pass through the Feishu monitor test, but repeat-run validation remains below repository policy; no stored-data contract changes.

Label justifications:

  • P3: This is a test-stability repair with no production or user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository state identifies this as a member-authored, test-only repair, so contributor real-setup proof is not required. The PR reports a controlled failure and after-fix pass through the Feishu monitor test, but repeat-run validation remains below repository policy; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • leilei3167: Raw commit be531ed adds extensions/feishu/src/monitor.post-replay.test.ts:120 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: be531ed2427b; files: extensions/feishu/src/monitor.post-replay.test.ts)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record 20 clean standalone runs and three clean original-shard runs under the repository’s flake-triage policy.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

Publication handoff: exact-head CI is green for 4b815568451d7d883c642f2ef37082397ee3e4fc, and native review/preparation are complete. Squash auto-merge is not armed: native merge admission refused before dispatch with ClawSweeper review gate failed: completed review is missing or expired. No merge outcome was created.

The underlying review completed in ClawSweeper run 36270386859, job 108483092577, but its publication step at 20:46:21 UTC hit GitHubRateLimitError for repository_actions. It deferred application with skipped_runtime_budget; the overall workflow reported success despite no durable review completion comment. Review artifact exact-review-36270386859-1 (artifact 10915217250) exists. The acknowledgment's “review complete / result being finalized” text does not satisfy the native completion gate.

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.

@steipete
steipete merged commit bc51e9a into main Sep 26, 2026
168 checks passed
@steipete
steipete deleted the fix/l95-feishu-replay-settlement branch September 26, 2026 21:06
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant