Repository navigation
fix(qa-lab): stop matrix probe re-polling at the deadline - #124684
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 12:20 PM ET / 16:20 UTC. ClawSweeper reviewWhat this changesThis PR prevents the Matrix QA harness from starting a residual retry after its discovery deadline when either the request timer or outer deadline timer fires first. Merge readinessKeep open. The patch records deadline ownership at the Matrix probe owner instead of inferring it from timer ordering, preserves fast-failure retries, and adds deterministic coverage for both timeout orders; no blocking correctness finding was found. Priority: P3 Review scores
Verification
How this fits togetherThe QA Lab Matrix harness starts a temporary homeserver and probes its candidate URLs before scenarios run. Each probe combines a request timeout with an overall discovery budget, then either retries, selects a reachable endpoint, or reports startup failure. flowchart LR
A[Matrix QA startup] --> B[Candidate URL probes]
B --> C[Per-request timeout]
B --> D[Discovery deadline]
C --> E[Deadline ownership decision]
D --> E
E --> F[Retry or fail]
B --> G[Reachable Matrix endpoint]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +36. Total +40 across 2 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep deadline ownership in the Matrix probe loop, retain the typed timeout classification, and land after an exact-head current-main validation confirms the clean merge. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: on current main, a request timeout at the remaining discovery budget returns false without recording deadline consumption, allowing the residual-sleep branch before the next deadline check. Is this the best way to solve the issue? Yes. The patch records the deadline fact where the request signal is created and removes the message-prefix coupling; the generic QA fetch contract already accepts the supplied signal. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2b8e94ea4dba. 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
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where Matrix QA health discovery could sleep and start a doomed extra poll when the per-request timeout won a race with the overall discovery timeout at the same deadline. The race caused unrelated CI jobs to flake with an observed
sleepImpl(1)call.Related: https://github.com/openclaw/openclaw/actions/runs/31954674724
Why This Change Was Made
The probe loop now owns each request timeout signal and records when that timeout represents the remaining discovery budget, so the re-poll decision comes from the deadline rather than timer ordering. The outer harness timeout uses an internal typed error instead of a message-prefix contract. Fast candidate failures still re-poll, while either deadline-owned timeout ordering stops immediately.
The tests force the outer-timeout-wins and request-timeout-wins orderings independently. This supersedes the temporary residual-sleep tolerance added in #124656 with a production repair and restores the zero-extra-poll assertion.
AI-assisted: yes.
User Impact
No normal Matrix harness behavior changes. QA runs retain fast-failure retries but no longer spend an extra poll cycle after the discovery budget is exhausted, eliminating this timing-dependent CI flake.
Evidence
does not re-poll when the request timeout wins at the discovery deadlinefailed with exactly onesleepImpl(1)call.node scripts/run-vitest.mjs extensions/qa-lab/src/live-transports/matrix/substrate/harness.runtime.test.tspassed 20/20 consecutive runs (15 tests per run).check:changedplan passed in an isolated native-arm64 Linux container after Blacksmith/AWS capacity was unavailable (local-container, leasecbx_ddea227e302e, exit 0), including extension production/test typechecks, lint, runtime-sidecar loading, and import-cycle checks.git diff --check origin/main...HEADpassed..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --stream-engine-outputreported no accepted/actionable findings.