Skip to content

fix(qa): preserve prepared runtime during suites - #130345

Merged
RomneyDa merged 5 commits into
mainfrom
fix/qa-prepared-runtime-isolation
Aug 30, 2026
Merged

RomneyDa merged 5 commits into
mainfrom
fix/qa-prepared-runtime-isolation

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

What problem this solves

Maturity run 32992034783 exposed two independent writers mutating the checkout that a QA suite had already prepared:

  • Native Vitest global setup rebuilt packages/ai/dist while concurrent live Gateway flows were still importing it. In the local pre-fix reproduction, the required AI module was absent in 329 of 644 polls during three concurrent setup calls.
  • cli-onboarding bypassed the suite Docker candidate preparation, so its package helper deleted root dist and attempted a fresh build. When that build ran out of memory, every later script inherited missing_private_qa_dist.

Repair

The suite launcher now marks native children as consumers of its prepared dist, so their E2E setup cannot clean or rebuild the runtime under live gateways.

Script-owned Docker invocations now declare their scheduler candidate lane. QA Lab feeds those lanes through the existing scheduler-owned immutable candidate preparation before any serial script starts. Canonical Docker lane batching is unchanged; onboarding, Compose, and package-install scripts receive the same frozen candidate environment instead of packaging independently.

This extends the immutable-candidate owner boundary introduced by #121253 rather than adding a retry, timeout, fallback, or downstream guard.

Verification

  • Regression: keeps native Vitest setup on the suite-prepared runtime fails on pre-fix code because the child receives no prebuilt-dist marker.
  • Regression: prepares the Docker candidate before a script-owned Docker lane fails on pre-fix code because cli-onboarding does not trigger preparation.
  • node scripts/run-vitest.mjs extensions/qa-lab/src/suite-launch.runtime.test.ts extensions/qa-lab/src/test-file-scenario-runner.docker.test.ts extensions/qa-lab/src/scenario-catalog.test.ts — 130 passed.
  • pnpm tsgo:extensions:all — passed.
  • node scripts/check-changed.mjs -- <changed files> — passed, including all typechecks, lint, import-cycle and repository guards.
  • Duplicate search: no open PR matched the prebuilt-dist marker, prepared-runtime failure, or Docker-candidate gap. fix(qa): reuse one immutable Docker candidate #121253 is the merged owner-boundary foundation; this PR closes the uncovered script-owned lane.

Scope and risk

QA infrastructure only; no shipped runtime, public API, config, or persistence change. The candidate metadata is internal scenario-catalog data. Docker preparation still runs only after concurrent flow/native partitions settle. A preparation failure stops scripts before they can mutate the prepared checkout.

Production/config LOC: +20/-3 (net +17). Tests: +58/-1 (net +57). Positive production growth is the explicit candidate-lane ownership contract plus propagation of the existing immutable-runtime contract; there is no duplicate execution path to remove.

No changelog entry: no user-visible product behavior change.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 6:57 PM ET / 22:57 UTC.

ClawSweeper review

What this changes

The PR makes the QA suite prepare the AI runtime before Vitest consumers start and lets script-owned Docker scenarios declare a scheduler-prepared package candidate lane.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open. The latest head resolves the prior Playwright regression by building the shared AI runtime only when a Vitest partition exists, while retaining the prepared-runtime and prepared-Docker-candidate repairs. This remains necessary because current main lacks both protections; exact-head QA automation is still in progress.

Priority: P2
Reviewed head: f7918488d8c1b5d8e1cc555aabfdf42cdcd927ac

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, owner-boundary repair with prior findings addressed; completion of exact-head automation is the remaining merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored QA-infrastructure PR is outside the external-contributor real-behavior-proof gate. The supplied focused-test results are supporting evidence only; the read-only review did not execute the suite, and exact-head CI remains pending.
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 QA-infrastructure PR is outside the external-contributor real-behavior-proof gate. The supplied focused-test results are supporting evidence only; the read-only review did not execute the suite, and exact-head CI remains pending.
Evidence reviewed 7 items Vitest preparation is limited to the affected runner: The scheduler builds the AI runtime only when the concurrent partition map contains Vitest, before any concurrent partition starts; the child receives the prebuilt marker through the native-runner path.
Playwright remains independent: The final-head regression keeps a Playwright-only suite on the normal runner and asserts that the AI build command is never invoked. The UI setup uses a separate temporary UI build path and does not consume the prebuilt-dist marker.
The original Vitest global setup honors the marker: The E2E global setup returns before either build command when OPENCLAW_E2E_USE_PREBUILT_DIST is set, establishing the consumer-side contract used by the scheduler.
Findings None None.
Security None None.

How this fits together

QA Lab schedules flow, Vitest, Playwright, and script scenarios from one checkout. It prepares shared build/package artifacts, then passes the appropriate environment to child runners so concurrent tests do not overwrite each other’s inputs.

flowchart LR
  A[Selected QA scenarios] --> B[Unified suite scheduler]
  B --> C{Vitest partition present?}
  C -->|Yes| D[Build shared AI runtime]
  C -->|No| E[Start non-Vitest partitions]
  D --> F[Vitest child uses prepared runtime]
  B --> G[Prepare Docker candidate lanes]
  G --> H[Script-owned Docker checks]
  E --> H
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head automation checks are still incomplete, so the altered suite scheduler should not merge until those checks pass.
  • Resolve merge risk (P1) - The repair adds net 42 production/config lines to QA automation; source inspection found distinct scheduler, runtime, and declared-lane responsibilities rather than a duplicate path to delete, but that added maintenance surface needs exact-head validation.
  • Complete next step (P2) - No repair lane is needed: the previously reported Playwright blocker is fixed on the current head, and the remaining action is normal exact-head automation completion.
Agent review details

Security

None.

PR surface

Source +39, Tests +108, Other +3. Total +150 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 3 42 3 +39
Tests 2 109 1 +108
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 3 0 +3
Total 8 154 4 +150

Review metrics

Metric Value Why it matters
Production versus test delta production/config +45/-3 (net +42); tests +109/-1 The production growth adds a scheduler-owned preparation boundary and three internal lane declarations; the larger test delta covers Vitest ordering, Playwright independence, and Docker-candidate propagation.

Merge-risk options

Maintainer options:

  1. Validate the exact head (recommended)
    Let the current exact-head QA and changed-scope checks finish successfully before merging the scheduler and candidate-preparation change.

Technical review

Best possible solution:

Retain the scheduler as the single preparation owner, merge only after exact-head checks validate the Vitest, Playwright, and script-Docker partitions together.

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

No reviewer-executed reproduction was performed in this read-only review, but the current-main scheduler path and the final-head ordering regressions give a high-confidence source reproduction boundary.

Is this the best way to solve the issue?

Yes. The unified scheduler is the correct owner for shared runtime and Docker-candidate preparation; leaving either operation to concurrent child processes would reintroduce competing writers.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs an internal QA reliability defect with a bounded effect on CI and developer validation, not shipped runtime behavior.
  • 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 MEMBER-authored QA-infrastructure PR is outside the external-contributor real-behavior-proof gate. The supplied focused-test results are supporting evidence only; the read-only review did not execute the suite, and exact-head CI remains pending.
  • remove P1: Current review triage priority is P2, so this older priority label is no longer current.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs an internal QA reliability defect with a bounded effect on CI and developer validation, not shipped runtime behavior.
  • merge-risk: 🚨 automation: The PR changes how QA partitions build and reuse runtime/package artifacts, so a scheduler error could affect automated validation beyond what ordinary source review settles.
  • 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 QA-infrastructure PR is outside the external-contributor real-behavior-proof gate. The supplied focused-test results are supporting evidence only; the read-only review did not execute the suite, and exact-head CI remains pending.

Evidence

What I checked:

Likely related people:

  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Allow the exact-head changed QA checks to complete successfully.

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-26T20:07:49.564Z sha 88b5e93 :: needs changes before merge. :: [P1] Prepare the runtime before marking native children prebuilt
  • reviewed 2026-08-26T20:57:46.478Z sha 0eb873b :: found issues before merge. :: [P1] Limit the prebuilt marker to prepared native partitions
  • reviewed 2026-08-26T21:29:38.273Z sha acde532 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-29T22:42:21.612Z sha e33b44f :: needs changes before merge. :: [P2] Restrict AI-runtime preparation to Vitest partitions

@RomneyDa

Copy link
Copy Markdown
Member Author

Addressed the current P1 on exact head 0eb873b64659c5670cc67878c79a85c04ab6453e.

The unified scheduler now builds the missing packages/ai/dist runtime once, before any concurrent native partitions begin. Only after that command succeeds can native children receive OPENCLAW_E2E_USE_PREBUILT_DIST=1; a preparation failure exits before child launch. The regression begins with no AI runtime, has the preparation producer create it, and verifies the child observes both the artifact and marker in that order.

Proof:

  • focused Vitest: 77/77 pass across test/scripts/vitest-e2e-global-setup.test.ts, extensions/qa-lab/src/suite-launch.runtime.test.ts, and extensions/qa-lab/src/test-file-scenario-runner.docker.test.ts
  • pnpm tsgo:extensions:all: pass
  • full check-changed for the affected QA surfaces: pass, including extension/test types, lint, boundaries, database/runtime-sidecar guards, and import cycles
  • test-audit: regression exercises the observable producer-before-consumer boundary from an absent artifact; no test-only production seam
  • autoreview: clean, 0.98
  • repair delta: production +21/-0, tests +30/-1; the production growth is the scheduler-owned one-time preparation boundary and failure handling required before reuse is safe

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 26, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Follow-up P1 repair pushed at acde53238b61b05174a990c6e1995fcf3c52fe88.

The prebuilt-dist marker is now applied only to scheduler-prepared native Vitest/Playwright partitions. Ordinary script partitions keep their normal environment unless Docker candidate preparation supplies an explicit replacement environment. A regression uses the nested managed-gateway-service-lifecycle E2E script and proves neither env nor envMode is injected.

Proof:

  • focused suite-launch runtime: 62/62 passed
  • pnpm tsgo:extensions passed
  • full changed-scope gate passed
  • test-audit: owner-boundary behavior, no implementation-only seam
  • isolated autoreview clean, 0.99
  • delta: production +9/-5 (net +4 owner-boundary discriminator); tests +21/-0

@clawsweeper re-review

@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. 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. labels Aug 26, 2026
@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. and removed 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
@RomneyDa

Copy link
Copy Markdown
Member Author

Addressed the exact-head Playwright finding at f7918488d8c: Playwright partitions are still scheduled normally, but only a Vitest partition triggers the shared AI-runtime build. The existing Playwright-only scenario now asserts that no build command runs.

Regression proof: the new assertion fails on the pre-fix condition with the AI build invocation, then passes after the fix. Focused QA suite: 73/73 passed; git diff --check passed. The checkout-wide extension type gate could not run cleanly in this isolated worktree because the shared dependency tree lacks current IMAP workspace packages (mailparser, mailauth, imapflow); exact-head CI is the clean dependency gate.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 29, 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 exact_review_queue).
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 removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 29, 2026
@RomneyDa
RomneyDa merged commit ff68e65 into main Aug 30, 2026
246 checks passed
@RomneyDa
RomneyDa deleted the fix/qa-prepared-runtime-isolation branch August 30, 2026 00:25
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 30, 2026
* fix(qa): preserve prepared runtime during suites

* fix(qa): prepare native suite runtime

* fix(qa): keep prebuilt marker on native partitions

* refactor(qa): simplify Docker lane naming

* fix(qa): keep Playwright independent of AI build
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: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. 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