Repository navigation
test(reply): remove wall-clock wait from hung dispatch regression - #132391
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 1:35 AM ET / 05:35 UTC. ClawSweeper reviewWhat this changesThe PR changes the hung-dispatch regression to wait for reply resolution and advance the existing 30-second settlement deadline with Vitest fake time. Merge readinessKeep 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 Review scores
Verification
How this fits togetherIncoming 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
Before merge
Agent review detailsSecurityNone. PR surfaceSource +7. Total +7 across 1 file. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
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
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.