Skip to content

ci: webviews dev server files run at once, each on its own warm Vite cache (no bead) - #19831

Merged
teamleaderleo merged 5 commits into
feat-cmux-nextfrom
op-next-call-keys/web-dev-lane
Oct 12, 2026
Merged

teamleaderleo merged 5 commits into
feat-cmux-nextfrom
op-next-call-keys/web-dev-lane

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

#19812 fixed a race: files that start a Vite dev server shared one node_modules/.vite, and two running at once lost each other's optimized files. To fix it, #19812 ran all 41 of those files one at a time after the rest, and the web test phase went from 7m18s to 9m44s. This PR keeps them off any shared cache but runs them in parallel again:

  • Cache per process: the dev configs (vite.config.ts and therefore gallery-dev, vite.config.acpmux-pane.mjs, vite.config.settings-page.mjs) take cacheDir from CMUX_VITE_CACHE_DIR (dev-server/viteCacheDir.mjs). When it's unset, they keep Vite's default.
  • Warm, then copy:
    • run-webviews-tests.sh first runs one file per Vite config (pane, gallery, settings, default), alone. Each warms its config's own cache.
    • The remaining files then run CMUX_WEB_TEST_DEV_JOBS at once (default: half the jobs, 4 on react-apps-check).
    • Each runs on its own copy of its config's warm cache, deleted when it finishes.
    • No two processes ever share a cache, and none starts the cold first bundle beside another. Three cold starts at once was the stall the old comment describes.
  • Fallback: if a config's warming file fails, its cache can't be trusted, so that config's other files run one at a time on cold caches.

Testing

  • python3 tests/test_webviews_tests_per_file.py. The fake bun records each dev server file's cache, whether it found its config's warm marker, and how many ran at once.
    • Red on 982afd9: test_dev_server_files_run_at_once_each_on_its_own_warm_vite_cache failed. All 9 files shared one cache (1 != 9).
    • Green: 6 tests OK.
  • shellcheck is clean.
  • The real effect, the web phase wall time, is measured by this PR's react-apps-check. Numbers are in the comment below.

Changelog

none

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Restores parallel execution for webviews test files that start a Vite dev server, which #19812 had serialized to fix a race on the shared node_modules/.vite cache at the cost of 2.5 extra minutes on the web test phase.

  • Every dev config a test serves now optimizes into the cache CMUX_VITE_CACHE_DIR names via dev-server/viteCacheDir.mjs, and the dev server plugin prefers it over its per-port cache, which had been overriding vite.config.ts and leaving default-config files to start cold. A new test resolves each config and asserts its cacheDir.
  • run-webviews-tests.sh runs one warming file per config alone, then the remaining dev-server files run CMUX_WEB_TEST_DEV_JOBS at once (default a quarter of the jobs; half was CPU bound on the 8-core runner and broke frame-budget and attach-timing tests), each on its own copy of that config's warm cache, deleted when the file finishes. Files that call createServer now count as dev server files, and failed cache copies or cleanups no longer stop the lane.
  • A config whose warming file fails runs its other files one at a time on cold caches.

Written for commit 070cc36. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits October 12, 2026 03:44
…e cache

#19812 ran every file that starts a dev server one at a time after the
rest, so they never optimize into one node_modules/.vite at once; the
web test phase went from 7m18s to 9m44s. Pin the faster contract:
several at once, never on one cache, each but one per config starting
from a warmed copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cache

The dev configs read CMUX_VITE_CACHE_DIR (dev-server/viteCacheDir.mjs).
The runner runs one file per config first, alone, to warm that config's
cache, then the rest CMUX_WEB_TEST_DEV_JOBS at once (default half the
jobs), each on its own copy: no two share node_modules/.vite and none
starts the cold first bundle beside another. A config whose warming file
fails keeps its files one at a time on cold caches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 923afc09-53b2-4898-bcc9-9460d84f84db

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@blacksmith-sh

blacksmith-sh Bot commented Oct 12, 2026

Copy link
Copy Markdown

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
test/agent-pane-seen.test.ts/agent-pane-seen.test View Logs
test/instructions-notice.test.ts/instructions-notice.test View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Passes: CI passes on 070cc361d2.

CI passes on 070cc361d2 (run 38243510224 attempt 1).

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

CI fast guards passes on 070cc361d2 (https://github.com/manaflow-ai/cmux/actions/runs/38243510224). This covers only the fast guards, not CI: CI's result is the ci-status check, and the CI failure attribution comment names any failing test.

teamleaderleo and others added 3 commits October 12, 2026 04:26
At four at a time on the 8-core runner, per-file time barely moved and
instructions-notice's frame budget and agent-pane-seen's attach timing
failed under the load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red: vite.config.ts resolves to node_modules/.vite-dev-deps-0 (the dev
server plugin's per-port cache) with CMUX_VITE_CACHE_DIR set, and
new-tab-typing (createServer with vite.config.ts) gets no cache of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ache

cmuxDevServer's config hook set a per-port cacheDir over vite.config.ts's,
so the seven default-config files ignored CMUX_VITE_CACHE_DIR, copied an
empty seed and started cold together (the #19746 stall). The plugin now
prefers CMUX_VITE_CACHE_DIR. new-tab-typing and diff-toolbar-narrow call
createServer and were not matched as dev server files at all. Cache
upkeep in the worker no longer aborts the lane under set -e.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Test webviews phase on 070cc36 (run 38243510224): 7m56s for 197 files, 0 failed. That is 45 dev-server files, 2 at a time, each on its own warm Vite cache. With them serial after #19812 it was 9m44s. At 4 at a time (first push) it took 5m38s, but the 8-core runner ran out of CPU and instructions-notice (frame budget) and agent-pane-seen (attach timing) failed, so the default is now a quarter of the jobs (CMUX_WEB_TEST_DEV_JOBS overrides it). Review fixes: vite.config.ts's dev-server plugin had overridden the cache directory, and the createServer files (new-tab-typing, diff-toolbar-narrow) were not counted as dev-server files. Both have red-then-green tests (f233adb, then 070cc36).

@teamleaderleo
teamleaderleo merged commit 523becd into feat-cmux-next Oct 12, 2026
102 checks passed
@teamleaderleo
teamleaderleo deleted the op-next-call-keys/web-dev-lane branch October 12, 2026 12:25
@github-actions

Copy link
Copy Markdown
Contributor

Gallery

Review in feed

182 states changed: pages.settings/general-group-2, pages.settings/browser-group-2, pages.settings/invalid-host, pages.settings/invalid-search-template, pages.settings/general-group-4, ... · 1 new state · 43 broken states · 89 play checks failed

Diff page and renders (the run's gallery-pr artifact)

State Before · after
pages.settings/general-group-2 (Apple System Colors Light, webkit)
pages.settings/browser-group-2 (Apple System Colors, webkit)
pages.settings/general-group-2 (Apple System Colors, webkit)
pages.settings/invalid-host (Apple System Colors, webkit)
pages.settings/invalid-search-template (Apple System Colors Light, webkit)
pages.settings/general-group-4 (Apple System Colors Light, webkit)

176 more on the diff page.

Live preview (follows this branch; start it with scripts/gallery-live.sh up <branch> from an hq checkout):

  • pages.settings/general-group-2: /wt/op-next-call-keys-web-dev-lane/?entry=pages.settings#/pages.settings/general-group-2
  • pages.settings/browser-group-2: /wt/op-next-call-keys-web-dev-lane/?entry=pages.settings#/pages.settings/browser-group-2
  • pages.settings/invalid-host: /wt/op-next-call-keys-web-dev-lane/?entry=pages.settings#/pages.settings/invalid-host
  • pages.settings/invalid-search-template: /wt/op-next-call-keys-web-dev-lane/?entry=pages.settings#/pages.settings/invalid-search-template
  • pages.settings/general-group-4: /wt/op-next-call-keys-web-dev-lane/?entry=pages.settings#/pages.settings/general-group-4
  • agent-pane.edited-files-settings/defaults: /wt/op-next-call-keys-web-dev-lane/?entry=agent-pane.edited-files-settings#/agent-pane.edited-files-settings/defaults
  • 111 more on the diff page

Play checks failed (0 px anchor movement, 0 layout shift, no frame over 33 ms unless the entry gives a reason):

  • agent-pane.artifact-panel/versions (Apple System Colors, webkit): play: waitFor did not hold within 5000 ms
  • agent-pane.dictation/hide (Apple System Colors, chromium): play: no element for menuitem "Hide Dictation Button"
  • agent-pane.dictation/hide (Apple System Colors, chromium): play: no element for menuitem "Hide Dictation Button"
  • ui.disclosure/keyboard (Apple System Colors, webkit): step 2 press Space: anchor .disclosure-gallery-receipt moved 92.0 px (limit 0) · step 3 press Enter: anchor .disclosure-gallery-receipt moved 92.0 px (limit 0)
  • agent-pane.changes-options-menu/keyboard (Apple System Colors, chromium): play: waitFor did not hold within 5000 ms
  • agent-pane.composer-pickers/effort-press-drag-release (Apple System Colors Light, chromium): step 3 up text "High": layout shift 0.0010 (limit 0)
  • 443 more on the diff page

472 nondeterministic states differed from a second render of the same head (a clock or fixture leak) and are not counted as changes.

6170 unchanged · base 028cfa2 · head 070cc36

teamleaderleo added a commit that referenced this pull request Oct 12, 2026
…9897)

* test: agent-pane-seen's first pane connects slowly, as on a busy runner

Red: the stand-in answers the first initialize after 11 s, as a cold
dev server page on a busy runner reaches its attach (dev server files
run side by side since #19831). The test gives the attach 10 s, so it
fails, and its open page then takes the next test's held attach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: agent-pane-seen waits for a slow first attach and closes its pages

The first attach gets 60 s (its cold modules load slowly on a busy
runner); later waits keep 10 s. Each case closes its page even on a
failure, so a late attach cannot take the next case's held attach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo added a commit that referenced this pull request Oct 12, 2026
…9962)

* test: text-field-focus gives its first stage 120 s to load (cx-c332z)

Since #19831 dev server files run two at a time on a copied Vite cache,
so the first stage pays a cold dependency optimize under load and its
page.goto passed the default 30 s on every PR. The stage already gets
120 s to mount; goto now gets the same.

Red (base): CMUX_VITE_CACHE_DIR=<empty dir> taskset -c 0 bun test
test/text-field-focus.test.ts -> goto: Timeout 30000ms exceeded on
agent-pane.composer / new-chat (light), 21 pass 1 fail.
Green (this commit, same command, fresh empty cache): 22 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: the dev server scans the gallery pages for dependencies (cx-c332z)

Replaces the goto timeout. The dev server's optimizeDeps entries left
out the gallery, so a file whose first page is a gallery stage
(text-field-focus) found the agent pane's dependencies late and waited
on a re-optimize past goto's 30 s. With the gallery pages scanned, the
unchanged test passes cold on one core, 22 pass, and the file takes
103 s instead of 139 s, inside run-webviews-tests.sh's 120 s per-file
cap that a longer goto would have hit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant