Skip to content

fix(qa): tolerate expected Matrix sync long-poll deadlines - #117807

Merged
RomneyDa merged 2 commits into
mainfrom
codex/qa-matrix-sync-deadline
Aug 2, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
codex/qa-matrix-sync-deadline

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Aug 2, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where Matrix QA scenarios could fail after an otherwise expected empty /sync long poll reached the observer's HTTP deadline. The deadline error escaped as a permanent adapter failure, so the next scenario in a shared Matrix run inherited the poisoned observer state.

The failure was observed in the exact shared order matrix-approval-exec-metadata-single-event, matrix-e2ee-artifact-redaction, then thread-follow-up in the failed maturity run. Merged PR #117390 repaired replacement-relation observation but did not change this deadline path.

Why This Change Was Made

The Matrix observer now owns the abort signal for each /sync long poll and treats only that signal's deadline as an empty poll. The shared request helper accepts the owner-provided signal; auth responses, HTTP errors, protocol/transport errors, and unrelated TimeoutError instances remain terminal.

This keeps timeout policy at the observer boundary instead of matching error text, adding retries, or weakening Matrix request failures globally.

User Impact

QA operators can run Matrix scenarios in shared order without an expected idle long poll poisoning the next scenario. Product Matrix runtime behavior and timeout configuration are unchanged.

Evidence

  • Blacksmith Testbox focused proof: 15/15 Matrix request and sync tests passed, including deadline recovery, same-observer reuse, terminal auth errors, and unrelated timeout errors.

  • Earlier focused proof on the initial implementation shape: 15/15 passed.

  • Node 26.3 live contract check confirmed AbortSignal.timeout() aborts its own signal with a TimeoutError; the implementation keys on signal ownership, not the error name.

  • git diff --check passed after rebasing onto current main.

  • Production delta: +25/-13 (+12 net). Tests: +102/-0.

  • Blacksmith Testbox exact shared-order proof: 10/10 runs passed; 30/30 scenarios in the original failing order, using the live local Tuwunel/Matrix E2EE path with the deterministic mock provider.

AI-assisted: yes.

Exact-head local Matrix proof

  • Head: 560051985562298a2344b279d30abe2d1b648b27.
  • Lane: disposable Docker-backed Tuwunel, real Matrix plugin/E2EE transport, and mock-openai.
  • Exact shared order, repeated consecutively ten times: matrix-approval-exec-metadata-single-event, matrix-e2ee-artifact-redaction, thread-follow-up.
  • Result: 30/30 passed (10 × 3). Per-run elapsed times: 113.890s, 58.574s, 69.506s, 91.049s, 93.739s, 65.821s, 60.755s, 55.449s, 61.719s, and 53.863s; total proof wall time 13m56.819s.
  • No scenario retries, timeout increases, or product/config changes were used.
  • Redacted local summaries, reports, and evidence are preserved under .artifacts/matrix-real-shared-order-560051985562/proof-01 through proof-10.
  • Teardown verified: no Tuwunel/Matrix harness containers, networks, or volumes remained.
  • Exact-head CI: passed.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 5:52 AM ET / 09:52 UTC.

ClawSweeper review

What this changes

The branch lets the Matrix QA room observer pass and recognize its own /sync long-poll abort signal, so an expected idle deadline does not poison the next shared scenario.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer-owned, maintainer-labeled PR open for human merge review. Current main still propagates the Matrix observer’s request-timeout abort as a terminal failure, while this branch narrowly makes only the observer-owned deadline an empty poll and includes strong exact-head Matrix proof; no discrete correctness defect was found in the patch.

Priority: P2
Reviewed head: 560051985562298a2344b279d30abe2d1b648b27
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused, preserves non-owned failures, and has strong real Matrix QA proof; only current-base maintainer confirmation remains.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body provides exact-head Docker-backed Tuwunel/Matrix E2EE shared-order proof with 30 of 30 scenarios passing, alongside focused request and observer checks.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides exact-head Docker-backed Tuwunel/Matrix E2EE shared-order proof with 30 of 30 scenarios passing, alongside focused request and observer checks.
Evidence reviewed 6 items Current-main failure boundary: Current main creates the /sync request through the shared helper with only timeoutMs; a request abort therefore rejects the observer poll and is not converted into an empty long poll at the observer boundary.
Narrow owner-boundary repair: The proposed helper preserves its existing default timeout for every caller, while the Matrix observer supplies one signal and catches only an error identical to that signal’s reason; other request, auth, protocol, and late body failures rethrow.
Regression coverage: The added tests cover an owned deadline followed by reuse of the same observer, unrelated TimeoutError propagation, authentication failure propagation, and a response-body failure after the deadline has fired.
Findings None None.
Security None None.

How this fits together

Matrix QA scenarios use a room observer to long-poll the Matrix /sync endpoint and record observed events for scenario assertions. The observer’s result is reused by later waits, so a terminal polling failure can affect the next scenario in a shared run.

flowchart LR
  A[Matrix QA scenario] --> B[Room observer]
  B --> C[Sync long poll]
  C --> D{Owned deadline?}
  D -->|yes| E[Empty poll result]
  D -->|no| F[Terminal request failure]
  E --> G[Next observer wait]
  F --> H[Scenario failure]
Loading

Decision needed

Question Recommendation
Should maintainers merge this bounded Matrix QA observer reliability repair after confirming its current-main merge result? Merge after current-base confirmation: Confirm the current merge result and required checks, then land the scoped observer-boundary repair.

Why: The patch and supplied real Matrix proof are strong, but the PR is maintainer-authored and carries the protected maintainer label, so this workflow must not auto-close or auto-merge it.

Before merge

  • Resolve merge risk (P1) - GitHub’s supplied state marks the branch as mergeable but behind main; exact-head Matrix proof is strong, but maintainers should confirm the current three-way merge result and required checks before landing.
Agent review details

Security

None.

PR surface

Source +12, Tests +134. Total +146 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 25 13 +12
Tests 1 134 0 +134
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 159 13 +146

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Merge the owner-scoped timeout classification after a current-base refresh confirms that the exact merged head retains terminal handling for every non-owned Matrix request failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Merge the owner-scoped timeout classification after a current-base refresh confirms that the exact merged head retains terminal handling for every non-owned Matrix request failure.

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

Yes, from source and the supplied exact-head evidence: let the observer-owned Matrix /sync deadline expire, then reuse the same observer for a subsequent event wait. This read-only review did not execute the Docker Matrix lane locally.

Is this the best way to solve the issue?

Yes. The observer owns the long-poll policy, and identity-checking its supplied abort reason is safer than matching error text or weakening shared Matrix request failures.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: The PR repairs a bounded Matrix QA workflow failure that can disrupt shared scenario runs but does not alter product Matrix runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides exact-head Docker-backed Tuwunel/Matrix E2EE shared-order proof with 30 of 30 scenarios passing, alongside focused request and observer checks.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact-head Docker-backed Tuwunel/Matrix E2EE shared-order proof with 30 of 30 scenarios passing, alongside focused request and observer checks.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: The available current-main blame assigns the observer polling and shared request path to this contributor; deeper provenance is unavailable in the local shallow/promisor history. (role: current-area history boundary; confidence: medium; commits: 81031012b222; files: extensions/qa-lab/src/live-transports/matrix/substrate/sync.ts, extensions/qa-lab/src/live-transports/matrix/substrate/request.ts)
  • RomneyDa: This contributor authored the proposed repair and the supplied related context identifies their already-merged Matrix observer work on the same subsystem. (role: recent Matrix QA contributor; confidence: high; commits: 39cc0a3199f5, 54fe011358e3, 560051985562; files: extensions/qa-lab/src/live-transports/matrix/substrate/sync.ts, extensions/qa-lab/src/live-transports/matrix/substrate/sync.test.ts)

Rank-up moves

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

  • Confirm the current merge result and required checks on the exact head to be merged.

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-02T04:35:44.928Z sha 54fe011 :: needs changes before merge. :: [P2] Preserve late terminal sync failures
  • reviewed 2026-08-02T04:46:58.804Z sha 54fe011 :: found issues before merge. :: [P2] Match only the observer deadline error
  • reviewed 2026-08-02T09:04:33.509Z sha 5600519 :: needs maintainer review before merge. :: none

@RomneyDa RomneyDa self-assigned this Aug 2, 2026
@clawsweeper clawsweeper Bot added 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 2, 2026
@RomneyDa
RomneyDa merged commit 85a8551 into main Aug 2, 2026
204 of 214 checks passed
@RomneyDa
RomneyDa deleted the codex/qa-matrix-sync-deadline branch August 2, 2026 09:56
vincentkoc added a commit to zenglingbiao/openclaw that referenced this pull request Aug 2, 2026
* origin/main: (59 commits)
  fix(agents): reject false success from delegated file mutations (openclaw#117938)
  fix(macos): reopen AI choice, fix daemon error text, hand onboarding off to the dashboard custodian (openclaw#117921)
  fix(qa): tolerate expected Matrix sync long-poll deadlines (openclaw#117807)
  feat(cli): support --json across reporting commands (openclaw#117928)
  perf(cli): keep read-only commands on cold paths (openclaw#117932)
  fix: prevent fractional chunk limits from stalling text splitting (openclaw#117727)
  fix(qqbot): add heartbeat-ACK liveness watchdog (openclaw#114902)
  chore(openai): defer release note to release flow
  fix(pr): join worktree discovery subprocesses
  test(gateway): widen aggregate event-loop budget (openclaw#117931)
  fix: refresh Buzz room targets after reconnect (openclaw#117927)
  fix: invalidate removed Buzz mention members
  fix: align Buzz explicit mention semantics
  test: split Buzz mention delivery coverage
  fix: preserve Buzz reply session threads
  refactor: keep Buzz mention helpers internal
  fix: invalidate stale Buzz room targets
  fix: tighten Buzz mention disambiguation
  perf: keep Buzz plain sends on the fast path
  fix: reject unresolved Buzz mention text
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
…117807)

* qa(matrix): tolerate expected sync long-poll deadlines

* test(qa): preserve late Matrix sync failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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