Repository navigation
feat(agent-chat): detect complete HTML writes from every harness - #26219
teamleaderleo wants to merge 24 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
|
Owned by an agent session · session |
|
Found 78 test failures on Blacksmith runners: Failures
...and 68 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: |
|
Orphaned: no activity for 65 h, and no lane holds a lease on it. The orphan sweep could not merge |
… 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
#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>
|
Conflict wave: feat-cmux-next already contains this PR's change. 50e69a6 "feat(agent-chat): detect complete HTML writes from every harness (carry #26219) (#28732)" landed it. Of this PR's added lines, 881 of 969 are present in feat f06d9bd; the rest are later changes on feat to the same code. I pushed no merge. I did not close the PR; a person can close it. |
|
Superseded by #28732 (merged), the carry of this complete-HTML-write detection. Closing this copy. |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Completed HTML writes from every harness use the existing artifact preview. A full recorded ACP diff or a whole-file write input opens the document; a replacement-only edit snippet does not masquerade as an entire HTML file.
Leo asked: "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" and "like the claude.ai artifacts but imagien you didnt need to only have it on claude.ai...".
This builds on #25190. It preserves that PR's HTML/SVG/JSX aliases, preview surface, and exports, and replaces its detector with one pure helper shared by all harnesses. The helper accepts completed edit/fileChange records, keeps canonical file identity, recovers complete Write inputs even when the old contents are unknown, and excludes failed/running calls, shell commands, and partial or legacy unmarked Edit/replace snippets. It never reads a file or reconstructs a patch.
Each immutable completed tool update is parsed once through a weak cache. This adds no timer, scroll handling, storage, or per-token transcript walk. Recovered from the earlier nx-artifact-detect-1025 work at ddd3631.
A fresh Astra review found that Codex adoption labels multi-file changes “Edit N files,” including complete added HTML files. The final repair verifies per-file whole-add provenance through normalized tool records, preserving legacy snippet rejection. Final head, focused red→green and independent re-review receipts are pending; no SHIP is claimed yet.
Observed / Not run
Agent session: agent session