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

Merged
TE
7d ago
+189-18

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 f2ce3e81 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 (#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 f2ce3e81, and the webview artifact tests pass in CI at this head.

Agent session: agent session