Skip to content

improve(ui): cut E2E shard runtime by reusing the bundle - #118697

Merged
steipete merged 5 commits into
mainfrom
codex/ui-e2e-bundled-runtime
Aug 3, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/ui-e2e-bundled-runtime

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Control UI E2E shards repeatedly started and transformed the same Vite development app for every test file. On the measured shard, that duplicated setup dominated the run: 35 files and 139 tests took 358.21 seconds even though each file still needed only fresh browser and Gateway state.

Why This Change Was Made

Build and serve the production Control UI bundle once per serial Vitest shard, while preserving fresh browsers, contexts, pages, mock Gateways, file isolation, sharding, workers, concurrency, and timeouts. The three suites that inspect or intercept source modules keep private Vite development servers, and custom build-info tests automatically bypass the shared bundle.

User Impact

No product behavior changes. Maintainers get materially faster Control UI E2E feedback without removing tests or weakening assertions.

Evidence

  • Direct AWS Crabbox c7a.8xlarge, exact same lease and shard 1: 358.21s baseline -> 189.59s candidate, saving 168.62s (47.1%). All 35 files and 139 tests passed.
  • Post-rebase focused proof: 5 files and 15 tests passed, covering the bundled path, source-module recovery/interception, custom build info, MCP conformance, and minified theme colors.
  • Shard 2 broad rerun: 32/35 files and 100/103 tests passed in 178.37s; the only three failures occurred before app assertions because the reused runner no longer had Playwright's ffmpeg helper. The affected source-interception suite passed all 5 tests, and an earlier targeted AWS rerun passed the same 5/5.
  • oxfmt --check, direct Oxlint, and git diff --check passed.
  • Autoreview (Codex, GPT-5.6 Sol, high): no accepted/actionable findings.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 10:48 AM ET / 14:48 UTC.

ClawSweeper review

What this changes

The branch builds and previews the Control UI production bundle once per serial Vitest E2E shard, then reuses its address for ordinary E2E files while keeping private source servers where tests require them.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This PR remains necessary and is a focused, correct test-infrastructure optimization: it builds one Control UI bundle per serial E2E shard while preserving private Vite servers for source-sensitive and custom-build-info tests. No blocking patch defect was found; merge should wait for the exact-head checks already in progress. Likely related people: steipete (high confidence).

Priority: P3
Reviewed head: 4dd0790dd4376e7834c53dbdfc94062a5eb7e6b3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong real-run performance evidence supports a coherent lifecycle change with no source-level correctness finding; exact-head CI remains the final merge gate.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body provides after-fix same-host benchmark output and focused post-rebase E2E results that directly cover the shared-bundle path and its source-mode exceptions.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides after-fix same-host benchmark output and focused post-rebase E2E results that directly cover the shared-bundle path and its source-mode exceptions.
Evidence reviewed 6 items Shared-server owner boundary: The proposed helper returns the shard-scoped preview address only for ordinary calls; calls with custom build info or source: true still create a private Vite server, preserving the tests that inspect source modules or require a different build identity.
Shard lifecycle cleanup: Global setup creates the build in a tracked temporary directory, provides the preview URL to the project, and closes the preview server before removing the temporary output in teardown.
Source-sensitive coverage remains explicit: The locale retry E2E test observes Vite-served locale source modules, so the branch explicitly opts it into source-server mode rather than routing it through the production bundle. The same pattern is used for the other changed source-sensitive suites.
Findings None None.
Security None None.

How this fits together

Control UI E2E files normally start a Vite server before opening fresh Playwright browser contexts and mock Gateway connections. This change moves the expensive production build and preview-server startup to Vitest shard setup, while each test file still owns its browser, page, mock Gateway, and assertions.

flowchart LR
  Config[Vitest E2E shard config] --> Global[Shard global setup]
  Global --> Bundle[Build Control UI bundle]
  Bundle --> Preview[Preview server]
  Preview --> Address[Shared server address]
  Address --> Files[Per-file E2E setup]
  Files --> Browser[Fresh browser and mock Gateway]
  Browser --> Results[E2E assertions]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head Control UI E2E and broader CI checks are still in progress; merge should wait for those results because this change alters test-server lifecycle and build output placement.
  • Complete next step (P2) - No mechanical repair is needed; await the exact-head E2E and required CI results, then perform the normal maintainer merge decision.
Agent review details

Security

None.

PR surface

Source +97, Tests +89, Other +2. Total +188 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 2 120 23 +97
Tests 15 161 72 +89
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 18 283 95 +188

Review metrics

Metric Value Why it matters
Production vs test LOC production +11/-10, test harness +272/-85 The small production Vite change preserves default output behavior while allowing the test-only shard bundle to direct existing post-build plugins to isolated temporary output.

Stored data model

Persistent data-model change detected: serialized state: ui/src/e2e/appearance-settings-defaults.e2e.test.ts, serialized state: ui/src/e2e/board-mcp-app.e2e.test.ts, serialized state: ui/src/e2e/logs-layout.e2e.test.ts, serialized state: ui/src/e2e/session-dashboard.e2e.test.ts, unknown-data-model-change: ui/src/e2e/session-dashboard.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the one-build-per-shard design, with the existing explicit source/custom-build-info escape hatches, and merge only after the exact-head E2E shards and required checks confirm the lifecycle remains stable.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the one-build-per-shard design, with the existing explicit source/custom-build-info escape hatches, and merge only after the exact-head E2E shards and required checks confirm the lifecycle remains stable.

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

Not applicable: this is an E2E runner performance improvement, not a user-reported runtime failure. The provided same-host before/after shard run and focused post-rebase E2E run directly exercise the changed behavior.

Is this the best way to solve the issue?

Yes. Sharing the built preview server at the serial shard boundary removes repeated build and server work while retaining per-file browser/Gateway isolation and explicit private-server exceptions for source-dependent tests.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: The PR improves CI and E2E feedback time without changing the shipped Control UI 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 (terminal): The PR body provides after-fix same-host benchmark output and focused post-rebase E2E results that directly cover the shared-bundle path and its source-mode exceptions.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix same-host benchmark output and focused post-rebase E2E results that directly cover the shared-bundle path and its source-mode exceptions.

Evidence

What I checked:

  • Shared-server owner boundary: The proposed helper returns the shard-scoped preview address only for ordinary calls; calls with custom build info or source: true still create a private Vite server, preserving the tests that inspect source modules or require a different build identity. (ui/src/test-helpers/control-ui-e2e.ts:355, 4dd0790dd437)
  • Shard lifecycle cleanup: Global setup creates the build in a tracked temporary directory, provides the preview URL to the project, and closes the preview server before removing the temporary output in teardown. (test/vitest/vitest.ui-e2e.global-setup.ts:17, 4dd0790dd437)
  • Source-sensitive coverage remains explicit: The locale retry E2E test observes Vite-served locale source modules, so the branch explicitly opts it into source-server mode rather than routing it through the production bundle. The same pattern is used for the other changed source-sensitive suites. (ui/src/e2e/locale-offline-retry.e2e.test.ts:62, 4dd0790dd437)
  • Output-path preservation: The Vite configuration retains its default output directory and passes an explicit temporary output directory to both post-build plugins only for the shard bundle, preventing parallel shard processes from writing canonical dist output. (ui/vite.config.ts:383, 4dd0790dd437)
  • Feature-history provenance: The current-main E2E helper was introduced in current history by Peter Steinberger, and the proposed shard-reuse sequence is five commits by the same author; the final commit records the gateway-semantics adjustment at the reviewed head. (ui/src/test-helpers/control-ui-e2e.ts:324, 4dd0790dd437)
  • Real behavior evidence: The PR body reports a same-host shard benchmark of 358.21s to 189.59s with all 35 files and 139 tests passing, plus focused post-rebase coverage of the bundled path, source-mode exceptions, custom build info, MCP conformance, and minified theme colors. (4dd0790dd437)

Likely related people:

  • steipete: Current-main blame attributes the existing startControlUiE2eServer implementation to Peter Steinberger, and every commit in this proposed shard-reuse sequence is also authored by him. (role: introduced and recently maintained the Control UI E2E helper; confidence: high; commits: 06957a69d867, e12a687674e2, 4dd0790dd437; files: ui/src/test-helpers/control-ui-e2e.ts, ui/vite.config.ts, test/vitest/vitest.ui-e2e.config.ts)

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 (1 earlier review cycle)
  • reviewed 2026-08-03T14:16:24.588Z sha a558248 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 73535e4 into main Aug 3, 2026
168 of 170 checks passed
@steipete
steipete deleted the codex/ui-e2e-bundled-runtime branch August 3, 2026 15:01
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 3, 2026
* origin/main:
  fix(onboard): keep referenced provider secrets out of plaintext (#118702)
  docs: show canonical agent roster configuration (#118722)
  fix(channels): generate catalog from package manifests (#118097)
  fix(zalouser): distinguish probe timeout from auth failure (#111336)
  improve(ui): cut E2E shard runtime by reusing the bundle (#118697)
  fix(cli): publish completion caches atomically (#118715)
  fix(whatsapp): honor disabled self-chat without widening group access (#118711)
  fix(voice-call): terminate carrier calls after realtime startup failures (#118699)
  fix(slack): isolate GovSlack media trust and delivery (#118695)
  fix(browser): wrap page-controlled action results (#118691)
  fix(security): sanitize JSON-escaped forged content boundaries (#118698)
  test(qa): prove real yielded-child completion and channel delivery (#118707)
  fix(doctor): honor explicit plugin-only migration authority (#118700)
  fix(security): detect child_process calls through aliases and computed members (#116304)
  test(gateway): avoid async facade mock race (#118708)
  fix(gateway): preserve final speech during transcription shutdown (#118693)
  fix(gateway): resume durable outbound delivery retries (#118694)
  fix(plugins): reject external public-artifact hardlinks (#118689)
vincentkoc added a commit that referenced this pull request Aug 3, 2026
* origin/main: (78 commits)
  fix(parallels): recover Windows poll transport failures (#118479)
  fix(channels): deny unauthorized Discord and Telegram binding access (#118704)
  fix(test): bound shared git inventory lookup (#111171)
  fix(onboard): keep referenced provider secrets out of plaintext (#118702)
  docs: show canonical agent roster configuration (#118722)
  fix(channels): generate catalog from package manifests (#118097)
  fix(zalouser): distinguish probe timeout from auth failure (#111336)
  improve(ui): cut E2E shard runtime by reusing the bundle (#118697)
  fix(cli): publish completion caches atomically (#118715)
  fix(whatsapp): honor disabled self-chat without widening group access (#118711)
  fix(voice-call): terminate carrier calls after realtime startup failures (#118699)
  fix(slack): isolate GovSlack media trust and delivery (#118695)
  fix(browser): wrap page-controlled action results (#118691)
  fix(security): sanitize JSON-escaped forged content boundaries (#118698)
  test(qa): prove real yielded-child completion and channel delivery (#118707)
  fix(doctor): honor explicit plugin-only migration authority (#118700)
  fix(security): detect child_process calls through aliases and computed members (#116304)
  test(gateway): avoid async facade mock race (#118708)
  fix(gateway): preserve final speech during transcription shutdown (#118693)
  fix(gateway): resume durable outbound delivery retries (#118694)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
…8697)

* test(ui): reuse bundled runtime across e2e files

* test(ui): isolate bundled E2E build output

* test(ui): align bundled E2E output paths

* test(ui): register E2E setup entrypoints

* test(ui): preserve bundled E2E gateway semantics

---------

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
* origin/main:
  fix(onboard): keep referenced provider secrets out of plaintext (openclaw#118702)
  docs: show canonical agent roster configuration (openclaw#118722)
  fix(channels): generate catalog from package manifests (openclaw#118097)
  fix(zalouser): distinguish probe timeout from auth failure (openclaw#111336)
  improve(ui): cut E2E shard runtime by reusing the bundle (openclaw#118697)
  fix(cli): publish completion caches atomically (openclaw#118715)
  fix(whatsapp): honor disabled self-chat without widening group access (openclaw#118711)
  fix(voice-call): terminate carrier calls after realtime startup failures (openclaw#118699)
  fix(slack): isolate GovSlack media trust and delivery (openclaw#118695)
  fix(browser): wrap page-controlled action results (openclaw#118691)
  fix(security): sanitize JSON-escaped forged content boundaries (openclaw#118698)
  test(qa): prove real yielded-child completion and channel delivery (openclaw#118707)
  fix(doctor): honor explicit plugin-only migration authority (openclaw#118700)
  fix(security): detect child_process calls through aliases and computed members (openclaw#116304)
  test(gateway): avoid async facade mock race (openclaw#118708)
  fix(gateway): preserve final speech during transcription shutdown (openclaw#118693)
  fix(gateway): resume durable outbound delivery retries (openclaw#118694)
  fix(plugins): reject external public-artifact hardlinks (openclaw#118689)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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