Skip to content

feat(agent-chat): sandbox HTML artifacts before Run - #26216

Merged
teamleaderleo merged 26 commits into
feat-cmux-nextfrom
nx-artifacts-resume-a-1027
Oct 30, 2026
Merged

teamleaderleo merged 26 commits into
feat-cmux-nextfrom
nx-artifacts-resume-a-1027

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Agent-written HTML/SVG/JSX artifacts now work on the default shared cmux-page://cmux.agent/ host as well as the legacy agent host. Passive markup remains a script-disabled srcdoc; explicit Run uses the exact shared artifact endpoint cmux-page://cmux.agent/__artifact (or the legacy cmux-agent://render/artifact) and retains the opaque sandbox="allow-scripts" boundary.

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...".

This supersedes #25190, whose owner explicitly handed the implementation to nx-chat. The CEF route is supplied by #26224, and the live stream/detector pieces are stacked in #26219, #26230. No project artifact storage or Austin's #8610 is touched.

The shared-host delta is test-first bdfa39f0944 → 6881532dbc1; it adds exact-origin capability/URL selection, the page descriptor frame source, shared-host passive/Run tests and keeps other RenderCard types unchanged. The CEF prerequisite's static SHIP and native evidence are recorded separately: build 9cb98bfe25ba167c7dbc0c6e succeeded on a fleet Mac, and C++ policy run 40539592231 exercised 149 red→green cases (2 policy failures before, 0 after). A real default-agent browser probe recipe is /tmp/cmux-cef-artifact-probe.py (SHA 4270e3e6ec83d4bb6558ec167acdaca403ad7c92419b7841d2435affb56b2a89); it needs the managed tagged app and the shared host's browser.eval/DevTools route.

Observed / Not run

  • Recovered A/D/B hosted captures and checks remain prior-source evidence. The A shared-host tests are red-first but were not run locally; at f2ce3e8 the hosted web check ran (react-apps-check shards green; the only web red is the base check) and AgentPaneArtifactNavigationTests passed on a fleet Mac. The CEF route (feat(agent-chat): serve artifacts in the shared CEF page host #26224) has landed. Not run: the managed default-CEF browser probe.
  • Scoped web format/lint, Swift parse, diff checks and prepush static checks pass. No local native/browser build or test was run.

No capture: the native change is only page routing and URL policy for artifact pages (AgentPageProvider, AgentPaneNavigation, AgentPaneRenderFrame), with no visible native UI of its own; AgentPaneArtifactNavigationTests passed on a fleet Mac at f2ce3e8, and the webview artifact tests pass in CI at this head.

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
@cursor

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

@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 f2ce3e8: 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=pr26216 -f ref=nx-artifacts-resume-a-1027 -f platform=macos -f backend_mode=local

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

gh run download 40988199306 -R manaflow-ai/cmux -n gallery-advisory-26216-f2ce3e81b59edd447f37af5a8bdc02e01827ec8d (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.artifact-panel/claude-write Apple System Colors Light changed 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/claude-write Apple System Colors changed 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/codex-write Apple System Colors Light changed 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/codex-write Apple System Colors changed 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/pi-write Apple System Colors Light changed 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/pi-write Apple System Colors changed 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/gemini-write Apple System Colors Light changed 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/gemini-write Apple System Colors changed 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/svg Apple System Colors Light unchanged 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/svg Apple System Colors unchanged 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/interactive-v1 Apple System Colors changed 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/interactive-v1 Apple System Colors Light unchanged 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/interactive-v2 Apple System Colors Light unchanged 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/interactive-v2 Apple System Colors unchanged 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/interactive-v3 Apple System Colors Light unchanged 0% own ArtifactPanel.tsx
agent-pane.artifact-panel/interactive-v3 Apple System Colors unchanged 0% own ArtifactPanel.tsx
agent-pane.chat-inspector-surfaces/transcript Apple System Colors Light unchanged 0% names ArtifactPanel.tsx
agent-pane.chat-inspector-surfaces/transcript Apple System Colors unchanged 0% names ArtifactPanel.tsx
agent-pane.chat-inspector-surfaces/diff-in-place Apple System Colors Light unchanged 0% names ArtifactPanel.tsx
agent-pane.chat-inspector-surfaces/diff-in-place Apple System Colors unchanged 0% names ArtifactPanel.tsx
agent-pane.chat-inspector-surfaces/document-beside Apple System Colors Light unchanged 0% names ArtifactPanel.tsx
agent-pane.chat-inspector-surfaces/document-beside Apple System Colors unchanged 0% names ArtifactPanel.tsx
agent-pane.chat-inspector-surfaces/diff-closed Apple System Colors Light changed 0% names ArtifactPanel.tsx
agent-pane.chat-inspector-surfaces/diff-closed Apple System Colors unchanged 0% names ArtifactPanel.tsx
agent-pane.summary-card/preview-tab-row Apple System Colors Light unchanged 0% names ArtifactPanel.tsx
agent-pane.summary-card/preview-tab-row Apple System Colors unchanged 0% names ArtifactPanel.tsx
agent-pane.summary-card/preview-pushed-inspector-tab-row Apple System Colors Light unchanged 0% names ArtifactPanel.tsx
agent-pane.summary-card/preview-pushed-inspector-tab-row Apple System Colors unchanged 0% names ArtifactPanel.tsx
agent-pane.summary-card/inspector-pushed-tab-row Apple System Colors Light unchanged 0% names ArtifactPanel.tsx
agent-pane.summary-card/inspector-pushed-tab-row Apple System Colors unchanged 0% names ArtifactPanel.tsx
agent-pane.summary-card/inspector-pushed-no-tab-row Apple System Colors Light unchanged 0% names ArtifactPanel.tsx
agent-pane.summary-card/inspector-pushed-no-tab-row Apple System Colors unchanged 0% names ArtifactPanel.tsx

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

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

CI failed on f2ce3e81b5 (run 40988199349 attempt 1): 1 code, 1 unknown.

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

Failures:

  • seen on other PRs rowSummary.test.tsx no description line on any Settings page is over 60 characters, in any language: failed (job)
  • seen on other PRs rowSummary.test.tsx every schema summary fits 60 characters in every language: failed (job)
  • seen on other PRs glyph-alignment.test.ts glyphs use shared row geometry in light and dark: failed (job)
  • seen on other PRs trailing-plates-tool-output.test.ts light: hovered tool output actions have no plate: failed (job)
  • seen on other PRs trailing-plates-tool-output.test.ts dark: hovered tool output actions have no plate: failed (job)
Matched log lines
web / react-apps-base-check (3): (fail) no description line on any Settings page is over 60 characters, in any language [14624.49ms]

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

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/41007613823 at 472bb3a failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at ae75b85. This pull request is one of 1 merged since: #26216.
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.

@teamleaderleo

teamleaderleo commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@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 added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 27, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

@blacksmith-sh

blacksmith-sh Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
src/pages/settings/rowSummary.test.tsx/rowSummary.test.tsx View Logs
src/pages/settings/rowSummary.test.tsx/rowSummary.test.tsx View Logs
test/browser/glyph-alignment.test.ts/glyph-alignment.test View Logs
test/browser/glyph-alignment.test.ts/glyph-alignment.test View Logs
test/browser/trailing-plates-tool-output.test.ts/trailing-plates-tool-output.test View Logs
test/browser/trailing-plates-tool-output.test.ts/trailing-plates-tool-output.test View Logs

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

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
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

  • webviews/src/agent-session/acpmux/conversation/writtenArtifacts.tsx:18-21 — raw write extraction only accepts file_path and path. Existing OpenCode and Gemini inputs use filePath and absolute_path; their no-diff HTML writes therefore produce no artifact, so no preview or Inspector entry appears for supported agent writes.

Use an artifact-specific native origin capability and frame URL selector so cmux-page://cmux.agent/ opens HTML/SVG previews and explicit Run loads cmux-page://cmux.agent/__artifact. Preserve the scriptless passive frame and allow-scripts consent boundary. Allow only that exact shared artifact endpoint in the agent descriptor frame CSP; other render cards retain their existing capability policy.

Validation: scoped vp fmt and vp lint pass on both production web files and focused tests, Swift syntax parse and git diff --check pass. Test-first commit bdfa39f is committed; no tests, builds, browser execution, push or dispatch were run.
Agent-Session: https://cmux.com/deeplink/agent?id=aid-196c8c4a1f392915fbea
teamleaderleo and others added 3 commits October 29, 2026 17:32
…s-resume-a-1027

# Conflicts:
#	Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentPaneRenderFrame.swift
#	Packages/macOS/CmuxNext/Tests/CmuxNextAgentPaneTests/AgentPaneArtifactNavigationTests.swift
#	release-notes/next/highlights/interactive-chat-artifacts.md
#	webviews/src/agent-session/acpmux/conversation/ArtifactPanel.tsx
#	webviews/src/agent-session/acpmux/conversation/artifactSandbox.ts
#	webviews/test/artifact-html.test.tsx
#	webviews/test/artifact-panel-sandbox.test.tsx
OpenCode sends filePath and Gemini absolute_path; only file_path and path
were read, so their no-diff HTML writes produced no preview or Outputs entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-a4efd6c1314eb5a4fc3e
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol high, review-router, for drain-transcript): SHIP at f2ce3e8

No findings.

Static review only.

@teamleaderleo
teamleaderleo merged commit 472bb3a into feat-cmux-next Oct 30, 2026
231 of 246 checks passed
@teamleaderleo
teamleaderleo deleted the nx-artifacts-resume-a-1027 branch October 30, 2026 05:17
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

lawrencecchen added a commit that referenced this pull request Oct 30, 2026
The slice head 2b2fc8e (= 43037147a0b's tree: slice + trunk sync c09bb74) merges the feat tip, 130 new
commits. 58 files conflicted:
- 0 reuse the previous round's resolutions: this round's base is the previous feat tip a14725a, so no hunk had
  all three sides equal to 5f39f9e's inputs.
- Regenerated, not hand-merged: the 4 CmuxMessagesLab patches (Fixture, Layout, RowDrawing, WindowView) from the
  merged vendored sources against the pinned upstream reconstructed from the side whose patch was consistent (feat's
  for 3, perf's for WindowView; feat 65de604 edited WindowView.swift without rewriting its patch).
- 54 resolved by porting feat's change into perf's shape:
  - Package.swift (CmuxNext: Floating tests get CmuxNextDesign with perf's Wakeups deps; CmuxMobileKit: Model gets
    feat's Resources with perf's CmuxSafeConcurrency).
  - Lineage parents #24136: SidebarSessionTreeFeed (recordedParents and per-host links on perf's ServiceObservation),
    RemoteAcpmuxWire (host/linksAlias notes posted on perf's mainWork; test-only inits take them too),
    AgentTabRemoteHost, AgentTabs+Wiring, AgentSessionWorkspace (the record is one completion task on main), tests.
  - Artifact sandbox #26216: perf's page-host PageArtifactFrame already serves the sandboxed endpoint; feat's
    navigation tests ported to PageNavigation, frame-ancestors expectation added, artifactFrameURL keeps only the
    page host, webviews tests on perf's URLs.
  - pane.commandAvailability (#25405) and chief.face (#27914) beside perf's keyToPaint and Wiring init.
  - State files off main #27749: AgentUnsentDrafts (perf's ObservedMap) and ScrollAnchors (blockingDecode) on
    AgentPaneStateFile.
  - AgentPaneTransport.close: perf's close reason plus feat's host-request failure and trust reset.
  - CloudService: perf's file, plus #27104 signedOutCreation (scope, policy, stop, signOut in +Machines) and #26740
    autosize/sizePick; listIsCurrent moved to +AppServer as feat did.
  - debug.object_menu into perf's DebugDriverControl; Home fixture presence/faces beside perf's field.
  - Palette overlay window #26951 into perf's paletteBuilt.
  - Per-window Home #27880 in perf's dockTab helper; active team (1bb1b96) on perf's cloudAuth.
  - Busy refusal (a930474, 2a9b813) in perf's LineTransport split (+State, +Route, framed write).
  - Launch snapshot sidebar doc (dc38061): DaemonLaunchSnapshot.sidebarDoc, shown once settled
    (whenSettled), its connect follow a ServiceObservation; the Rust test moved to launch_snapshot_tests.rs.
  - Hover card corners (bc66475) with perf's interactive flag; Chief pet state (#25671) on perf's
    ServiceObservation and AppearanceSignals; Chief picture crop (#27933) on perf's lanes and optional store;
    Home presence (#25578) as a FrameObservation; sidebar tab look (#27530) via SidebarLookFollower; settleOpenings
    (#24374) with perf's snap; Omnibar imports.
  - acpmux: inbox digest senders without slicing; withdraw_queued async with from_agents_only; cmux-tui-core and
    platform: connection leases beside perf's modules and InlineSocket (bounded_outbound.rs takes back the
    `platform::transport` import perf had dropped, which feat's claim_watched_connection names).
  - webviews: App/NewTab/NewTabScreen (retry, slash commands, at), settings keys moved to cardRows.ts.
- Feat's tests that call perf-changed inits fixed: TabConcentricCornerTests (input:), HomeChatPresenceFacesTests
  (deadlines:, frame delivery), RemoteChildSessionsTests (main run loop for posted notes).

Generators: cargo metadata in cmux-tui, cmux-tui/fuzz, Native/DiffSidecar and optchat-chief changed no lock;
gen-features.py --check, gen-chromium-host-wire.py --check and --check-ops, sync-resource-api.py --check pass.
webviews: bun run check passes. schemas/settings/settings-schema.json stays perf's (generated; the autofix
regenerates it): until then feat's chiefLook.test.tsx misses the home.bubbleColors rows.
teamleaderleo added a commit that referenced this pull request Oct 31, 2026
#26219) (#28732)

* fix(agent-chat): preview only complete recorded HTML writes (carry #26219)

Carries the part of #26219 that is not on base (#26216 landed the rest):
artifactWrites.ts with the partial-hunk guard and the multi-file add
provenance, plus test/artifact-writes.test.ts. writtenArtifacts.tsx now
re-exports toolArtifacts from it.

From #26219: 392a6af, 4ed83ed, 446f9c7, f9ce1d9,
bdf7318, ad5452b. Kept base's OpenCode filePath/absolute_path
write fields, with test cases for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-63b9964940c20354b639

* fix(agent-chat): a complete edit or replace of an HTML file keeps its Open

The edit-name guard from #26219 dropped every diff of an Edit/replace call
unless Codex add provenance proved it, so OpenCode's edit and Gemini's
replace, which record the whole old and new file, lost their preview and
Open. An edit-named call's unmarked diff now opens when it is shown to be
the file: it is not one of the replacement strings its input records
(Claude Code's Edit and MultiEdit diffs are exactly those) and the input
records some, or with no input its new text is a whole HTML document.
Marked fragments and legacy snippets stay closed.

Tests: a complete create, edit (Claude-shaped and OpenCode-shaped) and
replace open; Edit/MultiEdit replacement snippets, a no-input legacy
snippet and a marked fragment stay closed. Gallery: edit-complete,
replace-complete, edit-complete-open and edit-snippet artifact-panel states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f71664ebfb6cf5206479

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: cmux-bot[bot] <348531757+cmux-bot[bot]@users.noreply.github.com>
teamleaderleo added a commit that referenced this pull request Nov 1, 2026
…pted documents stay code

- http-equiv and <link> in the document are made inert (meta refresh
  navigates script-free; dns-prefetch/preconnect reach the network past CSP);
  x-dns-prefetch-control off.
- The frame script refuses link clicks; a second load tears the frame
  down to the source.
- A document with script never previews inline: it stays the code card,
  and Open takes it to the side panel where Run already is (#26216).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-92fa78a91e29868c5eaa
teamleaderleo added a commit that referenced this pull request Nov 1, 2026
…iew (#30673)

* Agent chat: draw a reply's closed html/svg fence as a sandboxed inline preview

A closed ```html or ```svg fence now draws as its document in an
iframe sandboxed with allow-scripts and no same-origin. Its srcdoc starts
with the artifact policy (no network); before Run only the frame's nonce'd
height reporter runs. Height follows the frame's own report, capped at
480 px. Code shows the source card (Copy kept). An open fence stays plain
code. Scripted documents wait for Run, then use the native artifact frame.
Meta refresh is made inert, link clicks are refused, and a frame that loads
twice falls back to the source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-92fa78a91e29868c5eaa

* Inline preview: keep frames on their document; no network hints; scripted documents stay code

- http-equiv and <link> in the document are made inert (meta refresh
  navigates script-free; dns-prefetch/preconnect reach the network past CSP);
  x-dns-prefetch-control off.
- The frame script refuses link clicks; a second load tears the frame
  down to the source.
- A document with script never previews inline: it stays the code card,
  and Open takes it to the side panel where Run already is (#26216).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-92fa78a91e29868c5eaa

* Inline preview: links that leave the document point to # (no speculative DNS of agent-written hosts)

Review of design/artifacts (gpt-6.1-sol) BLOCK: CSP does not stop an
engine resolving <a href> hosts. Clicks on them are refused anyway, so
cross-origin href/xlink:href become # with the original in data-href;
fragments and inline data:/blob: images stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-92fa78a91e29868c5eaa

* Inline preview: draw in the native artifact frame in the app; fix the link rewrite boundary; fragments scroll in place

Review (gpt-6.1-sol) BLOCK at 74ebf5a:
- a srcdoc frame takes the pane's CSP, which runs no inline script, so
  the nonce'd reporter never ran in the app. In the app the preview now
  uses the native artifact frame (own policy, no network, height report,
  host navigation delegate) with the inert, script-free document; srcdoc
  stays for the gallery; other pages show the source.
- the href rewrite consumed the boundary quote, so adjacent attributes
  slipped past; it is a lookbehind now, with that input covered.
- in srcdoc a #fragment resolves against the parent page; the frame
  script scrolls to it in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-92fa78a91e29868c5eaa

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

3 inactive deployments
artifacts — f2ce3e81 Deployed Oct 30, 2026 by teamleaderleo via add the Windows daemon to the tree #79654
sentry-dsyms — f2ce3e81 Deployed Oct 30, 2026 by teamleaderleo via upload cmux-tui dSYMs to Sentry #79654
ci-routing-agent — f2ce3e81 Deployed Oct 30, 2026 by teamleaderleo via cmux-tui tree preflight #79654
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant