Skip to content

cmux NEXT: the agent pane ships every stylesheet it imports, listed from the imports (base red) - #24161

Closed
teamleaderleo wants to merge 6 commits into
feat-cmux-nextfrom
agent-pane-css-from-imports
Closed

teamleaderleo wants to merge 6 commits into
feat-cmux-nextfrom
agent-pane-css-from-imports

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Every fleet DEV build (cmux-ci build, pr-capture) and the webview CI shards stop in the agent pane's web step on feat-cmux-next:

error: the agent pane imports webviews/src/ui/wave.css but build-agent-pane-web.sh does not add it to the page's styles

build-agent-pane-web.sh wrote the page's one <style> from a list of sheets kept by hand, and refused any sheet the pane imports that the list missed. So each new CSS import (ContextSection.css, then ui/wave.css from desktop.ts since #23995) stopped the web step, and with it every native capture, until someone added a line (78c71ce did for wave.css; fe14026 added composer/dropOverlay.css the same way while this PR was open). This PR removes the hand-kept list, so the next import can't do it again. It also covers the ContextSection.css case that #23939 fixes for that one file, and the wave.css case of #24141.

What changes

  • webviews/scripts/agent-pane/bundle.mjs --css-inputs now lists the sheets in the order the page applies them: esbuild's CSS bundle order (import order, each sheet at its first import, a sheet's @import ahead of it) for the graph of --page-styles and then the entry, followed by any sheet only a lazily loaded chunk imports, by path. It used to be a sorted list that only fed the check.
  • New webviews/src/agent-session/acpmux/pageStyles.ts imports the page's own sheets (the desktop layer, the base layer, the transcript and composer rules), in the old list's order. A component's own import "./x.css" needs no entry: it ships after these, at its first import.
  • build-agent-pane-web.sh writes the <style> from that list. It drops a sheet's @import of a sibling (the list carries the sibling ahead of it, as git.css before changes.css), skips acpmux/tailwind.css (still compiled and put last), and keeps both guards: every listed sheet's rules are in the page, and no @import reaches it.
  • dev.tsx and the gallery (dev-server/galleryHost.ts, which used to regex the shell script) read pageStyles.ts, so the dev server, the gallery and the app share one order. The gallery's list puts each sheet after the siblings it @imports (git.css before changes.css), as the page does, so editing git.css reloads the gallery's pane sheet and marks pane entries touched.

Behaviour

None for the app: built on cmux16 at base 972843d and at this head, the whole page output (index.html, pane.js, chunks/, locales/, the highlight worker) is byte-identical (diff -rq).

Takes back

Takes back #22710: its cat .../ui/importCards.css line in the hand-kept list goes with the list; pageStyles.ts imports ui/importCards.css at the same place, and the page still ships it there (output byte-identical).
Takes back #22815: its cat .../ui/glass/glass.css line goes the same way; pageStyles.ts imports ui/glass/glass.css right after desktop.css, as before.

Testing

webviews/test/agent-pane-styles.test.ts asks bundle.mjs for the list as the script does and checks that it holds wave.css, ContextSection.css, ghost.css, git.css and the page-level sheets, that it starts with desktop.css, that git.css comes right before changes.css, that it starts with the gallery's list, and that the built page carries every sheet in the list's order.

  • Red on base (the test commit alone): bun test test/agent-pane-styles.test.ts fails 2 tests (the list is sorted and has no page-level sheets).
  • Green on the head: the same command passes 4 of 4 after scripts/cmux-next/build-agent-pane-web.sh (5 of 5 with test/popup-surface-dev.test.ts, which now checks pageStyles.ts).

Observed / Not run

  • Observed on cmux16 (a blob-less checkout, bun 1.4.2): build-agent-pane-web.sh --check failed with the error above on fbcb3d3 (before 78c71ce) and passes on the head. The head's page output is byte-identical to base 972843d's.
  • Negative check: an indented @import "./ghost.css" screen; appended to ui/wave.css makes the script exit 1 with "an @import reached the agent pane's styles".
  • Fleet DEV builds of earlier heads passed the web step and produced the app: c436caaec321f545bb84096b (328523c) and be6439987e581e9e309e48c5 (ea2d75d).
  • vp fmt --check and vp lint on the changed files pass, as does scripts/cmux-next/prepush-gate.py. test/gallery-touched-rank.test.ts passes.
  • Not run: the full bun run check and the whole webviews suite (the sparse checkout lacks the Swift packages that some checks read) and the gallery dev server; the PR's CI covers those.

Changelog

none

Agent session: cosmic-gray

🤖 Generated with Claude Code

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

cursor Bot commented Oct 22, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

@teamleaderleo
teamleaderleo force-pushed the agent-pane-css-from-imports branch from 328523c to ea2d75d Compare October 22, 2026 04:50
@teamleaderleo teamleaderleo added risk:normal Risk tier (docs/ci/risk-tiers.md) and removed risk:normal Risk tier (docs/ci/risk-tiers.md) labels Oct 22, 2026
@blacksmith-sh

blacksmith-sh Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Found 58 test failures on Blacksmith runners:

Failures

Test View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs

...and 48 more test failures. View all on Blacksmith: run 39785809015, run 39785808836, run 39785808978

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

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review adc7fa6: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr24161 -f ref=agent-pane-css-from-imports -f platform=macos -f backend_mode=local

Unclear: web / react-apps-check failed: no known signature; failed step: Check webview test shards.

CI failed on adc7fa6ed1 (run 39785809015 attempt 1): 4 code, 1 unknown.

Job Verdict Why
web / react-apps-check (3) code a web test failed
web / react-apps-check (2) code a web test failed
web / react-apps-check (1) code a web test failed
web / react-apps-check (4) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs claimPaint.test.tsx a pooled Settings page claimed by the host reports its paint once its first screen is in: failed (job)
  • seen on other PRs claimPaint.test.tsx a Settings page loaded fresh reports its first paint once its first screen is in: failed (job)
  • seen on other PRs agent-pane-peer-chat.test.ts a chat on an SSH machine > counts its running turn from the prompt and offers no machine switch mid-...: failed (job)
  • seen on other PRs composer-edges.test.ts composer card: appearance.borders = none draws no edge: failed (job)
  • seen on other PRs composer-edges.test.ts composer card: one hairline edge by default: failed (job)
  • seen on other PRs composer-foot-pill-inset.test.ts the row's padding is counted from the inset, so only the pill grows, not the text's place: failed (job)
  • seen on other PRs composer-location-strip.test.ts the chat composer: no hairline across the seam under the strip: failed (job)
  • seen on other PRs composer-location-strip.test.ts the chat composer: no gap where the strip stands inside the card's corner: failed (job)
  • seen on other PRs strings.test.ts the settings strings generate with no missing translation: failed (job)
  • seen on other PRs strings.test.ts every key the page uses exists in all 21 locales: failed (job)
  • ... 21 more in the job logs
Matched log lines
web / react-apps-check (3): (fail) a pooled Settings page claimed by the host reports its paint once its first screen is in [1072.32ms]
web / react-apps-check (2): (fail) the settings strings generate with no missing translation [299.29ms]
web / react-apps-check (1): (fail) rows of an older page fade in once as they come into view; opened and live rows do not [4447.83ms]
web / react-apps-check (4): (fail) a change's picture opens enlarged on a click, and Close closes it [237.03ms]

Not re-run automatically: web / react-apps-check (3), web / react-apps-check (2), web / react-apps-check (1), web / react-apps-check (4), web / react-apps-check are not machine failures.

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.

red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: red check: Checks job structure (+2 more) is not red on the base 8c31792; do not merge until green; see lane-rules
red: cmux-next page strings generate; base red: the same failure on the base 8c31792; does not block
red: web / react-apps-check (1); no finished base run on 8c31792 to compare; do not merge until green; see lane-rules
red: web / react-apps-check (2); no finished base run on 8c31792 to compare; do not merge until green; see lane-rules
red: web / react-apps-check (4); no finished base run on 8c31792 to compare; do not merge until green; see lane-rules

Gallery before/after for adc7fa6: the capture produced no images (run).

teamleaderleo and others added 3 commits October 21, 2026 22:28
The page build writes its <style> from a hand-kept sheet list, and each new
CSS import (ContextSection.css, then ui/wave.css) stopped the web step and
every fleet app build. This asks bundle.mjs for the list from the imports
(--page-styles), in cascade order, and checks the page carries each sheet.

Red on feat-cmux-next fbcb3d3: the list is sorted, has no page-level sheets,
and pageStyles.ts does not exist.

Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1603a-6462-72f0-a4b0-6937eb58e4c3&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rom the imports

build-agent-pane-web.sh wrote the page's <style> from a hand-kept list and
refused any imported sheet the list missed, so each new CSS import stopped
the web step and every fleet app build ("the agent pane imports
webviews/src/ui/wave.css but build-agent-pane-web.sh does not add it to the
page's styles"; ContextSection.css before it).

bundle.mjs --css-inputs now lists the sheets in the order the page applies
them: the import graph of acpmux/pageStyles.ts (the page's own sheets, the
old list's order) and then main.tsx, as esbuild orders a CSS bundle. The
script writes the <style> from that list, drops a sheet's @import of a
sibling (the sibling ships ahead of it), and still checks every listed
sheet ships. dev.tsx and the gallery load pageStyles.ts, so dev, gallery
and app share one order.

The page is byte-identical to the old list plus wave.css, except that
wave.css lands after the listed sheets instead of after glass.css.

Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1603a-6462-72f0-a4b0-6937eb58e4c3&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…siblings

Review (codex xhigh) found two gaps. The page guard only caught @import at
column 0, so an indented or conditioned one stayed in the <style>, where the
browser drops it; it now refuses any @import outside comments, and the
sibling strip allows leading whitespace. The gallery listed only
pageStyles.ts's direct imports, so an edit to git.css (which changes.css
@imports) neither reloaded the gallery's pane sheet nor marked pane entries
touched; agentPaneStylesheets now puts each sheet after the siblings it
@imports, as the page does, and the test compares the lists unfiltered.

Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1603a-6462-72f0-a4b0-6937eb58e4c3&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo force-pushed the agent-pane-css-from-imports branch from ea2d75d to 934d72b Compare October 22, 2026 05:32
Review (codex xhigh): CSS keywords ignore case, so "@import \"./print.css\"
print;" got past the case-sensitive guard and its sheet would ship without
its condition. The guard, the sibling strip, the gallery's sibling regex
and the test now ignore case.

Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1603a-6462-72f0-a4b0-6937eb58e4c3&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex xhigh, correctness first): SHIP at c3184d5

Codex (xhigh) reviewed the diff over three rounds:

  • 328523c and ea2d75d: BLOCK. The @import guard only matched column 0, and the gallery's list left out git.css, which changes.css @imports, so an edit to it neither reloaded the gallery's pane sheet nor marked pane entries touched. Fixed in 934d72b.
  • 934d72b: BLOCK. The guard was case-sensitive, so @IMPORT "./print.css" print; got through (CSS keywords ignore case). Fixed in c3184d5.
  • c3184d5: SHIP, with no remaining correctness findings. It confirmed by probing that uppercase and mixed-case conditioned imports are refused and plain sibling imports are stripped, and that git.css still comes right before changes.css.

At this head the whole agent pane output is byte-identical to the base build, and an appended @IMPORT "./ghost.css" print; makes the script exit 1.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next guards / cmux-next page strings generate is red on 13 of 13 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next guards / nightly-guards / workflow-guard-tests / release-notary is red on 12 of 13 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Checks job structure is red on 13 of 13 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › No fleet host names in gallery fixtures is red on 10 of 11 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › No new SwiftUI (macOS UI is AppKit) is red on 11 of 11 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next web bundles (source-keyed cache) is red on 11 of 14 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@cursor

cursor Bot commented Oct 22, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Orphaned: no activity for 12 h, and no lane holds a lease on it. The orphan sweep could not merge feat-cmux-next in: conflicts in scripts/cmux-next/build-agent-pane-web.sh. Listed for a lane to resolve.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra xhigh, next-review): BLOCK at adc7fa6

  • scripts/cmux-next/build-agent-pane-web.sh:71: Removing the explicit CSS paths breaks webviews/test/pane-menus-styled.test.ts:20, which still extracts those paths from this script. It now finds zero stylesheets, so shippedCss is empty and the required menu-rule assertions fail. Update that test to consume the new stylesheet source.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Closing as superseded. feat-cmux-next 8125a40 (2026-10-25, "the page's sheets are derived from the dev server's entry; no hand-kept list in the script") already removed the hand-kept stylesheet list from scripts/cmux-next/build-agent-pane-web.sh and derives the pane's sheets from its imports in order. That is what this PR set out to do. The open Astra BLOCK here (the pane-menus-styled test reading the old list) does not apply to base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant