Repository navigation
feat(agent-chat): live reload completed artifact rewrites - #26238
teamleaderleo wants to merge 35 commits into
Conversation
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
…acts-resume-d-1027
…acts-resume-d-1027
…acts-resume-a-1027
…acts-resume-d-1027
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
…acts-resume-d-1027
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
Preserve the fence regressions from the existing live-reload implementation before splitting its repair. Focused hosted red/green execution is deferred until the A/D prerequisite repairs stabilize, as requested; local scoped formatting passes. The test-only scoped lint reports the expected missing artifactLive and identity APIs. Agent-Session: https://cmux.com/deeplink/agent?id=aid-7815c3051c74f136e044
Split the existing live-reload implementation into a standalone fence change with one bounded producer for row identity, event revision and generation. Preserve nested Markdown identities, plain/highlighter fallbacks, historical selection, Run consent and producer handoff. Written files retain their static D fallback; B2 will extend this producer. Validation: scoped vp fmt passes on all 16 changed files; browser-lane and fixed-wait checks pass. Scoped type-aware lint reports only the same unlift/follow exhaustive-deps warnings reproduced in base 305c545. Tests/builds and hosted red/green are deferred by coordinator instruction until prerequisite A/D repairs stabilize. No dispatch or push. Agent-Session: https://cmux.com/deeplink/agent?id=aid-7815c3051c74f136e044
Restore the existing written-file regressions before the B2 implementation. The two B1 fence producer cases move back into the shared original test file without source changes. Scoped formatting and type-aware lint pass; execution is deferred by coordinator instruction, with no tests or hosted dispatch. Agent-Session: https://cmux.com/deeplink/agent?id=aid-7815c3051c74f136e044
Restore only the approved B2 remainder of the verified live-reload implementation: extend the B1 producer with bounded tool publications and content-event order, follow canonical written-file identity across reconnects, and add the written live gallery fixture. No ArtifactPanel delta or prerequisite integration. Staged tree exactly matches bfd4176. Validation: scoped formatting passes on eight files; browser-lane and fixed-wait static checks pass. Scoped type-aware lint reports only the existing unlift/follow App warnings previously reproduced on D base. No tests, builds, hosted dispatch, push or PR; behavioral red/green deferred by coordinator instruction. Agent-Session: https://cmux.com/deeplink/agent?id=aid-7815c3051c74f136e044
A removed earlier tool can shift a completed file write to index zero. The regression models the dropToolItem row update after a newer write in another row and requires the newer content to remain selected. Execution is deferred by coordinator instruction; scoped diff check passes. Agent-Session: https://cmux.com/deeplink/agent?id=aid-7815c3051c74f136e044
This comment has been minimized.
This comment has been minimized.
A large activity row with many tools must not scan all prior items when only the trailing thought changes. The regression counts indexed reads through RowUpdates.note with an explicit changed index. Execution is deferred by coordinator instruction; diff check passes. Agent-Session: https://cmux.com/deeplink/agent?id=aid-7815c3051c74f136e044
Pass the trailing thought index to OrderedRows so RowUpdates skips the row-wide structural map on every thought chunk. Tool item identity and removal signaling remain unchanged. Scoped formatting passes; no tests, builds, dispatch, push or PR. Agent-Session: https://cmux.com/deeplink/agent?id=aid-7815c3051c74f136e044
Capture the actual AcpmuxDirectClient thought reducer calling OrderedRows.set after 1000 tools; this discriminator must fail before 28dc when no hint is passed. Exercise the real session reset seam followed by a lower-sequence write and reject snapshots from the old producer. Runtime execution is deferred by coordinator instruction; the earlier direct producer-note test alone is not red-before evidence. Agent-Session: https://cmux.com/deeplink/agent?id=aid-7815c3051c74f136e044
A session with the same id but a new createdAt can restart its sequence numbers. Reset creates a fresh OrderedRows producer so the open written cursor hands over once and accepts the new lower-sequence writes. Old snapshots retain the old producer generation and stay rejected after handoff. Page and history rebuilds retain the existing producer. Scoped formatting and type-aware lint on direct.ts and the regression file pass; tests/builds/dispatch/push are deferred by coordinator instruction. Agent-Session: https://cmux.com/deeplink/agent?id=aid-7815c3051c74f136e044
Bugbot needs on-demand usage enabledBugbot 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. |
Restore the inner HTML keys while preserving the stable outer artifact identity and explicit Run consent. useRenderFrame sends its initial document once, so a new accepted revision needs a fresh inner frame. Passive previews retain the script-disabled path. Hosted run 40536139997 supplied the meaningful existing test failure: Run live artifact retained the same iframe after a revision. Scoped formatting and diff checks pass; no local tests/builds/dispatch/push. Agent-Session: https://cmux.com/deeplink/agent?id=aid-7815c3051c74f136e044
|
Found 84 test failures on Blacksmith runners: Failures
...and 74 more test failures. View all on Blacksmith
|
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Unclear: CI failed on
Failures:
Matched log linesNot re-run automatically: Written by
Agents: |
|
For awareness: two P2s from #26159's review (now closed as superseded by this stack) still apply at b7f3400.
|
ba7a5e9 to
cb38a08
Compare
|
Review (subagent claude-opus-5-5 medium): BLOCK at b7f3400 The B2 code is sound as written. I read the delta from the B1 head (bd110c4) to this head: Follow-ups:
|
|
Owned by an agent session · session |
…26238) (#33165) * test: written artifacts follow the last completed rewrite Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-92f5e2b3a84ca0d6f951 * feat(agent-chat): live reload completed artifact rewrites An open written-file artifact follows later completed writes of the same file, ordered by when each write's tool ended. A chosen older version stays put, failed or running writes never replace it, and rows replayed after a reconnect that end before the shown write never move it back. Session Info's Outputs lists each file as its last completed write, not its last row. Ported from #26238 onto the current base (B1 #26230 landed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-92f5e2b3a84ca0d6f951 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
An open written-file artifact follows later successful rewrites of the same canonical file, including a tool completion that React coalesces out of its rendered snapshots. Choosing a historical version keeps it selected; failed or stale writes do not replace it.
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...".
B2 extends B1's single RowUpdates producer with a per-open subscription and a changed-tool pending map. Publication flushes that map even without listeners, carries event order across producer replacement, and never retains a prior-snapshot chain. Closing the panel, switching chats or unmounting disposes the subscription. No timer, file read, project artifact storage, new scroll correction or scan of loaded rows per token is added.
This is the written-file part recovered from this PR's original combined implementation. The stack is A (sandboxed HTML), D (complete-write detection), B1 (streamed fences), then this B2. It preserves A's explicit Run/no-network/file boundary and D's canonical path identity. The #25208 activity/command/transcript metadata stamps remain independent of the artifact producer.
Observed / Not run
51ef5efb8cf0fecc23d7f10d2f5961876c5b0e45(tree99ca2e51f449d09a4925d7300860e3417be3f5de) is stacked on B1 feat(agent-chat): live reload streamed artifact fences #26230 headbd110c44d31b9a3a20c0b86b95611b1a555ae72d; own delta +420/-71 across nine files. Final-head focused behavioral red→green, current web checks and independent Astra xhigh review are pending.Agent session: agent session