Skip to content

feat(agent-chat): isolate artifacts on shared WK page host - #26286

Merged
teamleaderleo merged 24 commits into
feat-cmux-nextfrom
nx-artifacts-wk-1027
Oct 29, 2026
Merged

teamleaderleo merged 24 commits into
feat-cmux-nextfrom
nx-artifacts-wk-1027

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

The shared cmux-page://cmux.agent/ page host now has the isolated artifact-frame contract used by the legacy agent host. PageArtifactFrame serves the exact __artifact endpoint with opaque sandbox allow-scripts CSP, a one-shot render protocol, data/blob-only media, and denial of artifact/srcdoc self-navigation, nested frames, network/file/page/bridge resources.

This is the shared WK fallback prerequisite for #26216; the CEF counterpart is #26224. Shared-page frontend Preview/Run integration belongs to the dependent change. Ordinary page routes remain unchanged.

Leo: "the /side thing i heard somebody really liked in codex... and i think html/html artifacts and that kinda good viewing and good support for it would be cool" / "like the claude.ai artifacts but imagien you didnt need to only have it on claude.ai...".

The interactive-artifacts highlight now links to the NEXT agents documentation. Frozen head: 8f90d5002ab4012ccfccfd668ff160bef4848349.

Validation:

  • Five digest tests passed in fleet run 40910011990, on tree b0b0861c1906b2e37aa03ccb6753ded3e7abcee2, identical to the frozen head's tree.
  • cmux-next guards 40910554261 passed at the frozen head.
  • Independent Astra high whole-diff static review: SHIP at the frozen head (39 files); execution evidence is separate.
  • Exact-head fleet daemon step 87cc86b14192f30b669a229a: all six suites passed (CmuxNextDaemonTests, CmuxNextMobileTests, FirstLaunchTests, ClassicImportTests, ClassicMigrationTests, ClassicUpgradeSimulationTests). theFirstLaunchBringsEverythingOnce passed all eight cases, and anOffSSHHostDoesNotHoldBackLocalWorkspaces passed.
  • The agent-pane tour passed all three steps; its light/dark stills passed automated privacy checks and manual inspection.

No capture: tour:core reached 20 passing steps, but its final Profile menu step needs a full-display screenshot. The current shared capture driver refuses every display step, including whole-display and Blacksmith captures; driver.py returns an unavailable result before executing the menu action. The exact-head attempt used build 8acc263942485ec43022bad8; the tour was refused and nothing from it was uploaded. This is a capture-driver limitation, not a successful core-tour receipt.

Capture tour-agent-pane at 8f90d5002ab4 (fleet build, capture mini, text checked for private data)

Light Dark
light dark

Agent session: agent session

Red: bun test test/artifact-html.test.tsx: 5 expected failures (no JSX kind or HTML write output). bun run check blocked by pre-existing design-token findings outside changed files; focused lint passed.
Agent-Session: https://cmux.com/deeplink/agent?harness=codex&session=01a1756c-cf95-7a30-a911-a4a2d18a4841&host=gcp-codex-lane-2
HTML/SVG/JSX use the existing side preview, with an offline native artifact endpoint, isolated scripts, and navigation refusal. Completed full HTML writes from normalized ACP tools appear in the transcript and Outputs, with file-based versions. React/Sucrase are bundled locally and loaded after Run.

Red 68de299107d: bun test test/artifact-html.test.tsx had 5 expected failures. Green: same command 7 passed; focused artifact/panel/Inspector suite 17 passed; scoped gallery suite 27 passed. Manual Chromium VM check: 10 fixtures and parent/storage/network/file/WebSocket/image/script policy probes passed, with captures. Web bundle build, typecheck, formatting and changed-file lint passed. Localization audit passed with no new keys.

Not run: native compilation and AgentPaneArtifactNavigationTests (Linux VM has no swiftc; integration owner runs fleet verification). Full web check remains red on untouched base design-token debt at a30f457. No PR or push; artifact A handoff to nx-chat.

Agent-Session: https://cmux.com/deeplink/agent?harness=codex&session=01a1756c-cf95-7a30-a911-a4a2d18a4841&host=gcp-codex-lane-2
Draw passive artifact markup in a script-disabled srcdoc frame, then reserve the native opaque allow-scripts endpoint for explicit Run. Parse inert HTML for consent markers and refuse srcdoc-origin navigation to allowed pane or loopback routes. Deduplicate the standalone opened-write version list by recorded body.

Validation: scoped vp fmt passes on seven web files; scoped vp lint passes on new safety/runtime files. App lint reports only existing unlift/follow exhaustive-deps warnings. Swift syntax parse and git diff --check pass. No tests, builds, browser execution, push or hosted dispatch were run locally; parent owns exact-head hosted red/green and review.
Agent-Session: https://cmux.com/deeplink/agent?id=aid-196c8c4a1f392915fbea
Carry toolCanonical onto synthesized full-write diffs so canonical creates and raw-input overwrites remain one document in Outputs and the opened artifact version list.

Validation: scoped vp fmt and vp lint pass on writtenArtifacts.tsx and artifact-html.test.tsx; git diff --check passes. The focused behavioral regression is committed first at fbfd741; tests and builds are deferred to the coordinator's hosted lane. No push or dispatch.
Agent-Session: https://cmux.com/deeplink/agent?id=aid-196c8c4a1f392915fbea
Regression command for hosted runner: scripts/cmux-next/test-cmux-page-path-cpp.sh. The first two new cases are statically red on the base because PageRequestAllowed accepts the artifact URL as the same page host. Native test execution intentionally deferred by task scope.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-ecd03ea7c2f13c412b34
Serve exact cmux-page://cmux.agent/__artifact with an opaque sandbox CSP and the one-shot render protocol. Gate artifact/srcdoc navigation before the main-frame fast return, deny network/file/page subresources throughout descendant frames, and retain normal page navigation.

Observed: scoped verify-local checks passed (localization-defaults, package-groups, feature-flags), git diff --check passed, bootstrap node --check passed. Not run: native CEF compilation, browser probe, and C++ tests, per task scope. Hosted regression: scripts/cmux-next/test-cmux-page-path-cpp.sh. Test-first parent b71fd15 contains two statically failing page-authority cases; hosted red/green still required.
Agent-Session: https://cmux.com/deeplink/agent?id=aid-ecd03ea7c2f13c412b34
Serve the exact cmux-page://cmux.agent/__artifact bootstrap with an opaque sandbox CSP and apply the one-shot direct-child navigation policy in shared WebKit pages. Ordinary page navigation remains unchanged.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-wk-artifact-frame
@socket-security

socket-security Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​sucrase@​3.35.110010010081100

View full report

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 8f90d50: 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=pr26286 -f ref=nx-artifacts-wk-1027 -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 8f90d5002a (run 40910555223 attempt 1): 2 code, 1 unknown.

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

Failures:

  • seen on other PRs MarkdownMath.test.tsx keeps shell command dollar signs as plain text without dropping content: failed (job)
  • seen on other PRs queuedMessages.test.ts each agent message is a received-card row, in the queue's order, with its promptId: failed (job)
  • seen on other PRs chiefLook.test.tsx search renders Bubble Style in the Look card: failed (job)
  • seen on other PRs inspector-section-order-browser.test.tsx Session Info's six-dot handles > every section has one: failed (job)
  • seen on other PRs transcript-fold-no-blank-space-browser.test.ts a long turn with notifications, bookkeeping and messages draws no blank space, folded or open: failed (job)
  • seen on other PRs transcript-send-remount.test.tsx sending keeps existing transcript rows mounted and does not redraw them: failed (job)
  • seen on other PRs themePane.test.tsx the Theme page draws each theme key once, in one card, with no second App Theme group: failed (job)
  • seen on other PRs agent-pane-pending-steer.test.tsx Send now on a waiting steer asks queue_edit send_now for its promptId, and goes once it is read: failed (job)
  • seen on other PRs bare-ref-repo.test.tsx an agent's message: its own address names the repository of its bare #N: failed (job)
  • seen on other PRs clickable-cursor.test.ts no stylesheet sets the arrow or auto on a clickable element: failed (job)
  • ... 4 more in the job logs
Matched log lines
web / react-apps-base-check (2): (fail) keeps shell command dollar signs as plain text without dropping content [5.29ms]
web / react-apps-base-check (1): (fail) the Theme page draws each theme key once, in one card, with no second App Theme group [1939.97ms]

Not re-run automatically: web / react-apps-base-check (2), web / react-apps-base-check (1), 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); no finished base run on eef18f1 to compare; do not merge until green; see lane-rules
red: web / Web status; base red: the same failure on the base eef18f1; does not block
red: web / react-apps-base-check (1); no finished base run on eef18f1 to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (2); no finished base run on eef18f1 to compare; do not merge until green; see lane-rules
red: web / react-apps-check; base red: the same failure on the base eef18f1; does not block

Gallery before/after for 8f90d50: 16 states rendered, 26 images differ, 2254 more touched states not rendered. Images are in the run's artifact, not on this public PR.

gh run download 40910552552 -R manaflow-ai/cmux -n gallery-advisory-26286-8f90d5002ab4012ccfccfd668ff160bef4848349 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.artifact-panel/claude-write Apple System Colors Light new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/claude-write Apple System Colors new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/codex-write Apple System Colors Light new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/codex-write Apple System Colors new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/pi-write Apple System Colors Light new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/pi-write Apple System Colors new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/gemini-write Apple System Colors Light new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/gemini-write Apple System Colors new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/svg Apple System Colors Light new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/svg Apple System Colors new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/interactive-v1 Apple System Colors Light new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/interactive-v1 Apple System Colors new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/interactive-v2 Apple System Colors Light new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/interactive-v2 Apple System Colors new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/interactive-v3 Apple System Colors Light new 0% own ArtifactPanel.gallery.ts
agent-pane.artifact-panel/interactive-v3 Apple System Colors new 0% own ArtifactPanel.gallery.ts
agent-pane.chat-inspector/full Apple System Colors Light unchanged 0% own OutputsSection.tsx
agent-pane.chat-inspector/full Apple System Colors unchanged 0% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-running Apple System Colors Light changed 0.0044% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-running Apple System Colors changed 0.0041% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-finished Apple System Colors Light unchanged 0% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-finished Apple System Colors unchanged 0% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-agent-row-compact Apple System Colors Light changed 0.0047% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-agent-row-compact Apple System Colors changed 0.0041% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-agent-row-detail Apple System Colors Light changed 0.0044% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-agent-row-detail Apple System Colors changed 0.004% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-agent-row-grid Apple System Colors Light changed 0.0043% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-agent-row-grid Apple System Colors changed 0.0041% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-agent-row-narrow Apple System Colors Light changed 0.0051% own OutputsSection.tsx
agent-pane.chat-inspector/workflow-agent-row-narrow Apple System Colors changed 0.0041% own OutputsSection.tsx
agent-pane.chat-inspector/layout-glance Apple System Colors Light unchanged 0% own OutputsSection.tsx
agent-pane.chat-inspector/layout-glance Apple System Colors unchanged 0% own OutputsSection.tsx

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

  • ArtifactPanel.tsx:279: Every running preview now uses the offline endpoint, including existing render-tool documents marked by artifact.render. Those documents previously supported CDN libraries and evaluated scripts. A Chart.js render now works inline but fails when opened in the side panel because its library is blocked. Preserve the existing render endpoint for render-tool documents.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Orphaned: no activity for 14 h, and no lane holds a lease on it. Adopted by the orphan sweep: merged feat-cmux-next in at 22cf4ef. A later pass queues it for the merge hub if it is reviewed, small and red only on base reds.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, review-router): SHIP at 22cf4ef

No concrete correctness, regression, or missing-test issues found in the reviewed diff.

VERDICT: SHIP

Agent session: agent session

@cursor

cursor Bot commented Oct 29, 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

For the owner of this stack (nx-chat; its host is unreachable right now): the Artifacts pane (#27264) needs the shared PageArtifactFrame/CEF/WK host policy to accept cmux.artifacts next to cmux.agent. The artifacts lane is building that extension as its own PR, stacked on this head (8f90d5002a), and it lands after this PR. Nothing will be pushed to this branch. If you'd rather carry the extension here, reply and we'll close ours.

Agent session: agent session

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at 8f90d50

No blocking findings.

Non-blocking: pr.md understates the scope: the diff also adds JSX execution, written-file previews, and CEF changes.

Static review only; tests were not executed.

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 8f90d50: an independent review passed this exact head (next-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo
teamleaderleo merged commit 1e27057 into feat-cmux-next Oct 29, 2026
214 of 223 checks passed
@teamleaderleo
teamleaderleo deleted the nx-artifacts-wk-1027 branch October 29, 2026 23:32
@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40974281406 at 12b4dc0 failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at d918111. This pull request is one of 2 merged since: #26286, #26975.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

Shipped in:

teamleaderleo added a commit that referenced this pull request Nov 2, 2026
Conflicts (from #26286 having landed as a squash): artifact_page.h, ArtifactPanel.tsx,
RenderCard.tsx, artifactSandbox.ts, artifact-panel-sandbox.test.tsx; the rest taken from base.
The shared preview now wraps the side panel's current frame instead of the pre-#31174 copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-159afad10a5ab45ea16c
lawrencecchen added a commit that referenced this pull request Nov 5, 2026
…igation with no source frame) (#36290)

* test(next): a WebKit navigation with no source frame gets a policy, not a trap (red)

macOS 14's WebKit gives a nil WKNavigationAction.sourceFrame for some
navigations although WebKit declares it nonnull. PageWebView and the agent
pane read sourceFrame.request.url through the Swift type, so the nil
NSURLRequest bridges to URLRequest and traps: the cmux-next app ended at
launch on macOS 14.8.7 (Tart smoke of 66339d3).

FakeNavigationAction (CmuxNextPagesTestSupport) answers the sourceFrame
getter with nil through the Objective-C runtime, as that WebKit does. Both
delegates trap on it at this commit.

* fix(next): read a WebKit navigation's frames without trapping on macOS 14

macOS 14's WebKit gives a nil WKNavigationAction.sourceFrame for some
navigations, although the header declares it nonnull. PageWebView (since
#26286, 1e27057) and AgentPaneNavigation read sourceFrame.request.url
through the Swift type: the nil frame answers a nil NSURLRequest, and its
bridge to URLRequest traps (URLRequest._unconditionallyBridgeFromObjectiveC).
The cmux-next app ended at launch on macOS 14.8.7 in
PageWebView.webView(_:decidePolicyFor:) (fleet build 83e04e0d8b97c62c796fc5aa,
Tart smoke 48cb9eceb51bb6143325b239, crashes=1); 15 and 26 pass.

CmuxNextDesign's WKNavigationAction.sourceFrameIfPresent / sourceFrameURL /
targetFrameURL and WKFrameInfo.requestURLIfPresent ask the Objective-C
runtime for the getters, whose answer is typed optional, so the optimizer
cannot fold a nil check away (as it may for `sourceFrame as WKFrameInfo?`,
which the browser's sourcePage used). Both navigation delegates and
sourcePage read through them. With a frame present, the URL is the same as
before; with none, the policy treats the source as unknown, as it already
does for a nil URL (the agent pane refuses an artifact frame it did not make).

Regression: PageNavigationNoSourceFrameTests and
AgentPaneNavigationNoSourceFrameTests (previous commit) trap at the base and
pass here.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 8f90d500 Deployed Oct 29, 2026 by teamleaderleo via namespace autofix #6318
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