Skip to content

fix(webviews): the agent-pane gallery test narrows its frame, so fast gates pass on base - #23334

Closed
teamleaderleo wants to merge 1 commit into
feat-cmux-nextfrom
cmux/gallery-frame-entry-path
Closed

teamleaderleo wants to merge 1 commit into
feat-cmux-nextfrom
cmux/gallery-frame-entry-path

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

check:browser-lanes fails on feat-cmux-next itself, which fails the Fast gates on the merge step for every PR whose merge touches webviews/. I hit it on #23131 and traced it to base, not to my branch.

The red

test/gallery-agent-pane-entries.test.ts:81: opens a gallery frame without entryPath, so it loads
  every gallery entry; use galleryFrame(entry, params) and warmGalleryFrame(vite, entry) from
  ./support/galleryFrame, or say why it needs them all in a "// gallery-frame-every-entry: <reason>" comment
test/gallery-agent-pane-entries.test.ts:90: (same)
error: script "check:browser-lanes" exited with code 1

Two landed PRs are each fine alone, and the pair is red: #23237 (c1d4c231c63e7) added this test using the old frame.html?entry=… shape, and the support/galleryFrame helpers plus the lane check that requires them arrived separately. No one did anything wrong — this is the same cross-PR interaction shape as #23281/#23286 earlier today, where two individually-correct merges combine into a red.

Evidence it is base and not a branch of mine: the file is byte-identical to base in the worktree where I found it (git diff origin/feat-cmux-next -- webviews/test/gallery-agent-pane-entries.test.ts is empty), none of my commits touch it, and this branch is cut from origin/feat-cmux-next with that one file changed.

The fix

-import { warmViteServer } from "./support/warmDevServer";
+import { galleryFrame, warmGalleryFrame } from "./support/galleryFrame";

-  const url = ({ entry, variant }: Case) =>
-    `http://127.0.0.1:${…port}/gallery/frame.html?entry=agent-pane.${entry}&variant=${variant}`;
+  const origin = () => `http://127.0.0.1:${…port}`;
+  const url = ({ entry, variant }: Case) => origin() + galleryFrame(`agent-pane.${entry}`, { variant });

-    await warmViteServer(vite, "/gallery/frame.html");
     browser = await chromium.launch({ headless: true });
+    await warmGalleryFrame(vite, [...new Set(CASES.map((item) => `agent-pane.${item.entry}`))], { browser });

galleryFrame adds the entryPath that narrows the page to the file defining the entry, which is the whole point of the check it was failing: the bare frame starts every *.gallery.ts(x) file's load — about 2,300 modules — and warming it transforms them all again. That cold load is what timed out markdown-selection-drag (#23080).

Warm-up is now once per distinct entry (9) rather than once per case (13), because an entry's variants share its file and the frame's own modules are cached after the first load. The browser launches before the warm-up so it can be reused, rather than the helper starting a Chromium of its own.

Verification

  • bun run check:browser-lanes → Browser test lane imports checked. (it is the failing check, and it now passes)
  • bun run check in webviews/ — the whole gate CI runs, all green: layers, type-scale, status-glyphs, system-blue, text-focus, dialog-keys, switch-fetches, catalog-keys, vp check (2148 files correctly formatted, no warnings, lint errors, or type errors in 2080 files), acpmux protocol codegen current.

Observed / Not run

Observed: the two commands above; the CI failure itself in the fast gates log of #23131 (web lint failed on the merge with base fb47146247e7); git diff origin/feat-cmux-next on the test file, empty, proving the violation is base content; git log attributing the file to #23237; support/galleryFrame.ts read in full, which is where the per-entry warm-up and entryPath behavior above come from.

Not run: the browser test itself. gallery-agent-pane-entries.test.ts gates on requireBrowserLane and self-skips outside CI or a Freestyle VM, and I did not force it past that guard on this host. So the behavior change I cannot show locally is the warm-up: warmGalleryFrame fails the warm-up if a stage does not mount, where warmViteServer on the bare frame did not load the stages at all. If one of the nine agent-pane entries is already failing to mount, this PR surfaces it as a warm-up failure instead of a per-case failure. That is what this PR's own react-apps-check shard runs, and I am waiting for it to come back green before merging rather than merging on the lint check alone.

Changelog

none

🤖 Generated with Claude Code

Agent session: big-red


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


Summary by cubic

Fixes the check:browser-lanes gate that fails on the base feat-cmux-next branch by updating the agent-pane gallery test to use the galleryFrame helper, which narrows the frame to the entry's file instead of loading every gallery entry.

  • Warms up once per distinct entry instead of once per case, since an entry's variants share its file.

Written for commit d9052af. Summary will update on new commits.

View guided diff Turn on auto-fix

… gates pass on base

`check:browser-lanes` fails on `feat-cmux-next` itself, which fails the "Fast
gates on the merge" step for every PR whose merge touches `webviews/`:

    test/gallery-agent-pane-entries.test.ts:81: opens a gallery frame without
    entryPath, so it loads every gallery entry
    test/gallery-agent-pane-entries.test.ts:90: ...

Two PRs landed in an order that left this red, each fine on its own: #23237
added this test with the old `frame.html?entry=…` shape, and the
`support/galleryFrame` helpers plus the lane check that requires them arrived
separately. Nothing was wrong with either; the pair is what is red.

The test now builds its URL with `galleryFrame("agent-pane." + entry, { variant })`,
which adds the `entryPath` that narrows the page to the file defining the entry,
and warms through `warmGalleryFrame` instead of `warmViteServer` on the bare
frame. Warm-up is once per distinct entry rather than once per case, because an
entry's variants share its file and the frame's own modules are cached after the
first load.

That is also the point of the check it was failing: the bare frame starts every
`*.gallery.ts(x)` file's load, about 2,300 modules, and warming it transforms
them all again — the cold load that timed out markdown-selection-drag (#23080).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15cb8-bbf0-7010-8d04-f9f2c0cb55df&host=big-red
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by chat-open-perf-6c on big-red · session

@teamleaderleo teamleaderleo added the risk:low Risk tier (docs/ci/risk-tiers.md) label Oct 21, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-2cpgp created for this PR by the cmux coordinator.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Closing this: the base red it fixes was already fixed on feat-cmux-next by #23325 (2bc7f2d3ae94e, merged 11:14 UTC), four minutes before I authored this head — the same change, down to the per-entry warmGalleryFrame(vite, [...new Set(...)], { browser }). origin/feat-cmux-next:webviews/test/gallery-agent-pane-entries.test.ts now imports galleryFrame/warmGalleryFrame and has no bare frame.html line, so check:browser-lanes is green on base and there is nothing left here to land. My searching for an existing PR before opening this one missed it because #23325 had not merged yet when I looked.

Everything else in this branch is cosmetic churn against another lane's landed work (an origin() helper and a destructuring style change), and the branch is CONFLICTING on exactly those lines, so there is no reason to resolve it. No follow-up needed.

@teamleaderleo
teamleaderleo deleted the cmux/gallery-frame-entry-path branch October 21, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant