Skip to content

test(reply): remove wall-clock wait from hung dispatch regression - #132391

Merged
steipete merged 1 commit into
mainfrom
codex/test-dispatch-deadline-execution
Aug 29, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-dispatch-deadline-execution

Conversation

@steipete

@steipete steipete commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The hung-dispatcher regression test spends thirty seconds waiting for the real settlement deadline on every run. Its dispatcher deliberately never settles; the elapsed wall time adds no transport coverage.

Why This Change Was Made

Use virtual time only in this case, wait until reply resolution has begun, then advance the unchanged thirty-second settlement deadline. Keep the separate 500ms lease-cleanup assertion and restore real timers in finally.

Draining every timer would hide an overlong cleanup lease. The bounded advance preserves that distinction and leaves production admission, settlement, and lease ownership unchanged.

User Impact

The existing case takes 0.168s instead of 30.155s locally. No production, sharding, worker-count, selection, configuration, or runtime timeout changes. Test/support LOC +9/-2; production +0/-0.

Evidence

  • Baseline: all 128 dispatch tests passed; the affected case took 30.155s. Final run: all 218 tests across dispatch, lifecycle, and turn-ledger suites passed, with the affected case at 0.168s.
  • Command: node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts src/auto-reply/reply/dispatch-from-config.turn-ledger.test.ts src/auto-reply/reply/dispatch-from-config.lifecycle.test.ts.
  • Negative probes removed the ledger deadline, removed bounded lease settlement, and substituted an excessive cleanup deadline; each failed. Temporary broken-code runs used a short runner timeout to bound hangs. No runner timeout is changed in this PR; original production and fixture bytes were restored before the final passing run.
  • Independent review caught the drain-all-timers coverage issue; the final bounded implementation addresses it. Fresh Codex autoreview and formatting passed. Installed Vitest timer semantics and the real lifecycle/ledger owners were inspected directly.
  • Linux changed-file checks passed (wrapper exit 0, Testbox stopped): https://github.com/openclaw/openclaw/actions/runs/33236302122. Exact-head CI passed: https://github.com/openclaw/openclaw/actions/runs/33236357774.
  • Latest ClawSweeper review found no actionable findings and requested normal exact-head CI; that request is satisfied.

@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 29, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 29, 2026
@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 1:35 AM ET / 05:35 UTC.

ClawSweeper review

What this changes

The PR changes the hung-dispatch regression to wait for reply resolution and advance the existing 30-second settlement deadline with Vitest fake time.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this maintainer-owned PR open: its single introduced test change remains absent from current main and preserves the independent 25 ms cleanup-bound assertion while removing the 30-second wall-clock delay.

Priority: P3
Reviewed head: 1927cafe734278b1d4f7dd575728f004a5b9e8e9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-consistent test cleanup that preserves the underlying timeout and cleanup invariants.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, test-only PR is exempt from the external-contributor proof gate; the supplied PR body nevertheless reports a focused after-change test run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, test-only PR is exempt from the external-contributor proof gate; the supplied PR body nevertheless reports a focused after-change test run.
Evidence reviewed 5 items Introduced test change: The pinned PR delta only changes the hung-dispatch test: it waits for the resolver before advancing the existing 30-second deadline, then restores real timers in finally.
Production timeout invariant: The production turn ledger creates a 30,000 ms failsafe race against dispatcher idle and clears the timer on completion; the PR does not modify this owner.
Cleanup-bound invariant: Lifecycle release waits through the owner-declared follow-up barrier policy, and the test continues to set its maximum to 25 ms before asserting admission release.
Findings None None.
Security None None.

How this fits together

Incoming replies run through the dispatch pipeline, which waits for delivery settlement before determining whether a visible reply occurred. The tested Slack bypass path holds a session-lifecycle admission until its dispatcher barrier settles or reaches its owner-declared bound.

flowchart LR
  A[Incoming Slack thread] --> B[Reply dispatch pipeline]
  B --> C[Reply resolution]
  C --> D[Delivery settlement deadline]
  D --> E[Lifecycle admission barrier]
  E --> F[Turn result and cleanup]
  G[Virtual test clock] --> D
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed because the proposed patch has no actionable review finding; await normal exact-head CI and maintainer handling.
Agent review details

Security

None.

PR surface

Source +7. Total +7 across 1 file.

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

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; test support +9/-2 The patch is confined to one existing regression test and does not change dispatch, delivery, or lifecycle runtime behavior.

Technical review

Best possible solution:

Land the focused virtual-time test update after exact-head CI completes, retaining the bounded settlement advance rather than draining all queued timers.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR optimizes an existing automated regression test rather than reporting a user-facing failure.

Is this the best way to solve the issue?

Yes: advancing only the known settlement deadline after resolution begins preserves the separate cleanup-bound check, unlike draining all timers would.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against dccdfedaae02.

Labels

Label changes:

  • add P3: This is a small test-runtime improvement with no introduced production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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: This maintainer-authored, test-only PR is exempt from the external-contributor proof gate; the supplied PR body nevertheless reports a focused after-change test run.

Label justifications:

  • P3: This is a small test-runtime improvement with no introduced production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only PR is exempt from the external-contributor proof gate; the supplied PR body nevertheless reports a focused after-change test run.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Authored the turn-ledger settlement work that owns the 30-second timeout exercised by this test. (role: delivery-settlement feature contributor; confidence: high; commits: e6e0f52aa8d8, c60c256bc3a7; files: src/auto-reply/reply/dispatch-from-config.turn-ledger.ts)
  • steipete: Recent history includes reply-run registry and lifecycle-boundary work, in addition to the proposed focused test update. (role: recent reply-lifecycle contributor; confidence: high; commits: 4d6c40ae3024, b8ff4fe3d7d6; files: src/auto-reply/reply/reply-run-registry.state.ts)
  • Vyctor H. Brzezowski: Introduced the current dispatch test-support file on main, including the pre-change regression case. (role: test-suite introducer; confidence: high; commits: 8bd895862d13; files: src/auto-reply/reply/dispatch-from-config.base.test-utils.ts)

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
steipete merged commit f0ade2d into main Aug 29, 2026
120 checks passed
@steipete
steipete deleted the codex/test-dispatch-deadline-execution branch August 29, 2026 05:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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