Skip to content

fix(qa): bound Matrix scenario preparation separately - #119996

Merged
vincentkoc merged 2 commits into
mainfrom
fix/qa-matrix-allowbots-preparation-20260806
Aug 7, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/qa-matrix-allowbots-preparation-20260806

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where Matrix allowBots QA scenarios could exhaust their short behavior timeout while the Gateway was still applying scenario configuration and restarting the selected Matrix account.

Related history: #111073, #112065, #114112, #116454, and #119431. Live search found no exact open duplicate; #119920 is adjacent Matrix E2EE readiness work with no touched-file overlap.

Why This Change Was Made

Matrix preparation now owns one absolute deadline of at least 60 seconds. That deadline is carried through prerequisite config/status RPCs, queued and running RPC execution, restart retry recovery, applied-revision checks, and fresh-account readiness.

The scenario context keeps its original behavior timeout. This does not change scenario YAML, retry counts, or Matrix policy. It adds one optional deadlineMs QA-runner Gateway-call option so adapters can carry an owner-defined preparation deadline through the plugin SDK boundary.

User Impact

Maintainers can run the isolated Matrix allowBots scenarios without setup latency consuming the 8-second behavior window, while failed preparation still ends with bounded RPC, revision, or account-readiness diagnostics.

AI-assisted: yes. The implementation and publication path were independently reviewed.

Evidence

Exact head and current merge state

  • Exact PR head: 375378ecfeea98888a7b1c850cdd2e3ea5ba0850.
  • Base before the signed two-commit refresh: f87d8bb72daaf9853b1f6c2e0dda7a1201d365b5.
  • Current main at evidence refresh: a0deb8edae1a72acc8d70d2b98298fc1de3376c0.
  • Main has 30 commits since that base with zero overlap across the seven PR paths.
  • Current synthetic merge tree: c7380e2c2e86a10b9e4ac4bdc52c4e0522f493fb; merge-tree and diff checks are clean.
  • Maintainer decision: accept the additive optional QA-runner deadlineMs contract as the canonical adapter-owned preparation-budget seam.
  • Production LOC: +180/-61 (net +119), adding the shared deadline/retry ownership boundary. Tests: +471/-51.

Exact-head scheduled CI

Synthetic merge-tree proof

  • Blacksmith Testbox was unavailable in the executor environment, so repository policy routed heavy proof to a fresh task-owned direct AWS Crabbox lease.
  • Provider: direct AWS Crabbox. Lease: cbx_45e8dfaffed6 (released).
  • Run: https://crabbox.openclaw.ai/portal/runs/run_64bf87ee3b71
  • Captured main/head: 9aa24e8f2e822290a4c4f785d48031f93c3f9fbb / 375378ecfeea98888a7b1c850cdd2e3ea5ba0850.
  • Synthetic merge: eee3c27dc76e99532ecac62a9493d1cd421f771f.
  • Parent 1: 9aa24e8f2e822290a4c4f785d48031f93c3f9fbb; parent 2: 375378ecfeea98888a7b1c850cdd2e3ea5ba0850; tree: d201903b7b72ec6958bc82a2a3d9a22ae588bbcb.
  • pnpm check:max-lines-ratchet --base refs/remotes/origin/ci-max-lines-base: passed.
  • node scripts/run-oxlint.mjs src ui/src packages extensions: passed with 0 warnings and 0 errors.
  • The synthetic checkout remained clean.
  • Main advanced after this remote run; the current-main zero-overlap and clean merge tree are recorded above and will be rechecked by native prepare.

Exact-head Matrix proof

Artifacts:

  • .artifacts/qa-e2e/matrix-allowbots-preparation-375378ec/qa-suite-report.md
  • .artifacts/qa-e2e/matrix-allowbots-preparation-375378ec/qa-suite-summary.json
  • .artifacts/qa-e2e/matrix-allowbots-preparation-375378ec/qa-evidence.json
  • .artifacts/qa-e2e/matrix-allowbots-preparation-375378ec/cleanup-summary.json
  • .artifacts/qa-e2e/matrix-allowbots-preparation-375378ec/post-run-cleanup-verification.json
  • .artifacts/qa-e2e/matrix-allowbots-preparation-375378ec/timing-summary.json
  • .artifacts/qa-e2e/matrix-allowbots-preparation-375378ec/deadline-contract.log
  • .artifacts/qa-e2e/matrix-allowbots-preparation-375378ec/private-qa-build.log
  • .artifacts/qa-e2e/matrix-allowbots-preparation-375378ec/matrix-live.log
  • .artifacts/qa-e2e/matrix-allowbots-preparation-375378ec/artifact-sha256.txt

Punchcard-Session: cobalt-valley-meadow-mg

@vincentkoc vincentkoc self-assigned this Aug 6, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 6, 2026 16:09
@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 6, 2026
@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

This PR carries a separate 60-second absolute deadline through Matrix QA Gateway configuration, restart recovery, RPC queuing, and account readiness so setup does not consume the scenario behavior timeout.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer review: the exact head appears to correctly separate Matrix QA preparation from behavior timing, but it adds an optional QA-runner plugin SDK call contract that needs explicit acceptance. Likely related people: RomneyDa (feature-history owner, high confidence) and steipete (recent adjacent QA readiness owner, medium confidence).

Priority: P2
Reviewed head: 375378ecfeea98888a7b1c850cdd2e3ea5ba0850
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is coherent and well-covered in source, with one maintainer-visible SDK compatibility decision remaining.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is outside the external-contributor proof gate; the prior live Matrix evidence is useful context but predates the current force-pushed head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is outside the external-contributor proof gate; the prior live Matrix evidence is useful context but predates the current force-pushed head.
Evidence reviewed 6 items Preparation owner and caller: The exact head creates one preparation deadline before Matrix flow setup and passes it through configuration, revision, and account-readiness work; the flow runner invokes preparation before scenario steps.
RPC deadline enforcement: The gateway client rejects expired queued or active callers while retaining queue ownership until the underlying request settles, preserving serialized RPC execution.
Current-main gap: Current main still uses the scenario timeout through Matrix preparation; it does not have the separate absolute deadline or the QA-runner deadline option.
Findings None None.
Security None None.

How this fits together

Matrix QA prepares a temporary Gateway configuration and waits for the selected Matrix account before running scenario assertions. Gateway RPC and restart readiness feed that preparation phase, which then hands control to the scenario’s independent behavior timeout.

flowchart LR
A[Matrix QA scenario] --> B[Preparation deadline]
B --> C[Gateway config and RPC queue]
C --> D[Restart and revision checks]
D --> E[Matrix account readiness]
E --> F[Scenario behavior checks]
Loading

Decision needed

Question Recommendation
Should OpenClaw accept deadlineMs as an additive QA-runner Gateway-call contract for adapter-owned preparation budgets? Accept the deadline contract and refresh Matrix proof: Retain the optional SDK field, run the ordered Matrix preparation scenario on the current head, and merge once normal exact-head gates are satisfied.

Why: Repository policy treats plugin SDK changes as compatibility-sensitive and requires visible maintainer approval even when the added option is source-compatible.

Before merge

  • Resolve merge risk (P1) - The optional deadlineMs field changes the QA-runner plugin SDK call contract despite the PR description saying public contracts are unchanged.
  • Resolve merge risk (P1) - The supplied live Matrix evidence names the pre-force-push head, so an ordered live preparation run on the current head would reduce residual merge uncertainty.
  • Complete next step (P2) - A maintainer must decide whether the additive QA-runner SDK deadline contract is acceptable; there is no narrow mechanical repair to dispatch.
Agent review details

Security

None.

PR surface

Source +119, Tests +420. Total +539 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 180 61 +119
Tests 3 471 51 +420
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 651 112 +539

Review metrics

Metric Value Why it matters
QA-runner contract 1 additive gateway-call option The new optional deadlineMs parameter crosses the plugin SDK boundary and needs compatibility acceptance before merge.

Merge-risk options

Maintainer options:

  1. Refresh exact-head Matrix evidence (recommended)
    Run the ordered Matrix allowBots/preparation scenario on 375378e and retain the additive deadline contract after maintainers accept it.
  2. Accept the remaining evidence gap
    Maintainers may merge based on the source review and green checks while accepting that the posted live run predates the force-pushed head.

Technical review

Best possible solution:

Accept the additive QA-runner deadline contract only if maintainers want it as the canonical way for adapters to bound preparation, then retain this single deadline path and capture current-head Matrix proof.

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

Yes, from source: current main threads the short scenario timeout through Matrix preparation, while the exact head gives that phase its own absolute deadline. The read-only review did not execute a live Matrix scenario.

Is this the best way to solve the issue?

Yes, provided maintainers accept the SDK contract: a single absolute preparation deadline avoids the old behavior-budget coupling and avoids multiplying per-call budgets across retries and queued RPCs.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: The PR adds an optional deadline parameter to the QA-runner plugin SDK Gateway call contract.

Label justifications:

  • P2: This is a bounded QA reliability repair with limited blast radius outside the QA runner.
  • merge-risk: 🚨 compatibility: The PR adds an optional deadline parameter to the QA-runner plugin SDK Gateway call contract.
  • 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 MEMBER-authored PR is outside the external-contributor proof gate; the prior live Matrix evidence is useful context but predates the current force-pushed head.

Evidence

What I checked:

Likely related people:

  • RomneyDa: Authored the merged Matrix QA config, restart, and timeout repairs that established this preparation path. (role: feature-history owner; confidence: high; commits: 6dc6d5efeeb7, 32b49bf2f134, b699a93c8710; files: extensions/qa-lab/src/live-transports/matrix/scenarios/scenario-environment.ts)
  • steipete: Recent merged QA account-readiness work and the current-base semantic refactor touch the same readiness boundary. (role: recent adjacent owner; confidence: medium; commits: bf1bdb429ece; files: extensions/qa-lab/src/gateway-child.ts, extensions/qa-lab/src/live-transports/matrix/scenarios/scenario-environment.ts)

Rank-up moves

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

  • Capture a redacted ordered Matrix preparation result on exact head 375378e.

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 (4 earlier review cycles)
  • reviewed 2026-08-06T17:37:34.334Z sha 88ca5d8 :: found issues before merge. :: [P2] Bound the entire Matrix preparation sequence | [P2] Keep gateway retries inside the remaining preparation budget
  • reviewed 2026-08-07T00:32:07.575Z sha e8565af :: needs maintainer review before merge. :: none
  • reviewed 2026-08-07T00:38:55.648Z sha e8565af :: needs maintainer review before merge. :: none
  • reviewed 2026-08-07T04:33:51.074Z sha e8565af :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 7, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Exact-head current-main proof

Head remained e8565affbee4ee288f06493ccb716e30d331ce47.

  • Provider/run: AWS Crabbox, lease cbx_4925aa5ae950, run run_568569c4c050
  • PREALLOC_MAIN: 1823be79ce7910e282d34e9540b3dfbebefbd213
  • command-start LIVE_MAIN: 1823be79ce7910e282d34e9540b3dfbebefbd213 (no drift after preallocation)
  • merge base: 70f84286c9ae20fd47dcf775b55ebb99296794de
  • changed-path overlap with live main: none
  • merge tree: 9d042cacc33e6f872c49d5c2eff9942cdaf80ba0
  • deterministic synthetic commit: d9abf8817ca5178e776e020006727c0bb054fd03
  • synthetic parents, in order: 1823be79ce7910e282d34e9540b3dfbebefbd213, e8565affbee4ee288f06493ccb716e30d331ce47

Remote setup ran pnpm install --frozen-lockfile, then only:

pnpm check:max-lines-ratchet --base refs/remotes/origin/ci-max-lines-base
node scripts/run-oxlint.mjs src ui/src packages extensions

Results:

  • setup: 16s, exit 0
  • max-lines ratchet: 21s, exit 0 (988 grandfathered suppressions)
  • oxlint: 253s, exit 0 (0 warnings, 0 errors across 23,869 files)
  • tracked synthetic tree: clean
  • command: 294.603s, exit 0, signal none
  • cleanup: exit 0; lease released and verified absent from active AWS leases

Captured evidence SHA-256:

  • stdout: b1d24c302d390a008bc01973d21c586947d602161871e1d6b56f0285c1e038e7
  • stderr: adc74732eb22eb921700fea1f63c5ec2a40a775f8a9109cf5aed00e2fa39df7d
  • proof script: b90288357dff32a3a1cbe7ddb119aaab7a96cac64d97aa1cc8c89d5edd487ab3

Prior exact-head live Matrix proof remains green: run run_8bc878def938, 3/3 ordered Tuwunel scenarios passed, 123/123 focused tests passed, and cleanup was clean.

Punchcard-Session: cobalt-valley-meadow-mg

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 7, 2026
Punchcard-Session: cobalt-valley-meadow-mg
Punchcard-Session: cobalt-valley-meadow-mg
@vincentkoc
vincentkoc force-pushed the fix/qa-matrix-allowbots-preparation-20260806 branch from e8565af to 375378e Compare August 7, 2026 04:54
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 375378ecfeea98888a7b1c850cdd2e3ea5ba0850.

@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 7, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Exact-head evidence is now current in the PR body for 375378ecfeea98888a7b1c850cdd2e3ea5ba0850: scheduled pull-request CI passed, fresh direct-AWS synthetic-merge gates passed, ordered Matrix/Tuwunel proof passed 3/3 after 123/123 focused tests and the private-QA build, and all task-owned leases are released.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc merged commit bb612cb into main Aug 7, 2026
137 checks passed
@vincentkoc
vincentkoc deleted the fix/qa-matrix-allowbots-preparation-20260806 branch August 7, 2026 05:53
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 7, 2026
…cope

* origin/main:
  fix(qa): bound Matrix scenario preparation separately (#119996)
  test(msteams): cover occupied webhook port (#120158)
  fix(agents): clear btw attribution reservations
  fix(agents): reserve execution attribution atomically
  fix(agents): reject attribution collisions before capture
  fix(agents): reject CLI attribution collisions
  fix(agents): reject private attribution recovery by run id
  fix(agents): restore runtime check cleanliness
  fix(agents): refresh rebound run admission time
  refactor(agents): propagate exact attribution across runtimes
  fix(release): provide prerelease plugin companions to package QA (#120107)
  test(macos): stabilize gateway session negotiation tests (#120141)
  refactor(test): replace logic-bearing vi.mock factories with boundary fakes, batch 2 (#120117)

# Conflicts:
#	src/agents/command/attempt-execution.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 8, 2026
* fix(qa): bound Matrix scenario preparation separately

Punchcard-Session: cobalt-valley-meadow-mg

* fix(qa): enforce Matrix preparation deadline

Punchcard-Session: cobalt-valley-meadow-mg
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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