fix(#1422): persist image asset bytes with insert-image/replace-image-src - #441
Merged
davidwkeith merged 1 commit intoAug 12, 2026
Merged
Conversation
…-src
processImageDrop writes the optimized primary WebP + responsive variants
under public/images/, but apply-edit-dispatcher.mjs's onApplied call only
ever passed {file, range} for the patched .astro source — the asset bytes
never made it into the anglesite/edits commit (or, for container-backed
runtimes, the host repo it gets persisted onto). A "successful" image edit
left the host with a source patch pointing at images that don't exist.
Reuse the multi-file {files: [...]} onApplied shape extract-component
already established, listing the source file plus every asset
processImageDrop wrote, so recordEdit commits them all onto one commit.
server/index-tools.mjs's onApplied wiring already branches on `files`
generically, so no wiring change was needed there beyond the doc comment.
Part of Anglesite/Anglesite#1422 (paired PR — the app PR consuming this
release is tracked separately). Does not address that issue's other,
unconfirmed defect: why the guest reply's commit can come back nil for
insert-image in the first place.
6 tasks
davidwkeith
added a commit
to Anglesite/Anglesite
that referenced
this pull request
Aug 12, 2026
The #81 smoke matrix's image-drop row has had no non-GUI substitute — a human found it silently failing (guest apply succeeds, nothing persists to host Source/, matching #718/#1066's shape but for insert-image) with no repeatable way to re-check it besides another manual drag-and-drop. Add an `insert-image` subcommand to anglesite-container-probe, alongside the existing `apply-edit` case-8 gate: boots a real LocalContainerSiteRuntime, drives an actual insert-image edit through MCPApplyEditRouter wired exactly like production, and asserts the reply's commit is non-nil AND that the host public/images/ asset the patched <img>'s src references actually exists — the assertion apply-edit has no equivalent of, since text edits have no associated binary asset. This gate can't pass yet: it needs the paired sidecar fix (Anglesite/anglesite-skills#441) tagged and vendored into this app's container image first. Scaffolding only, per #1422's scope — the issue's other, unconfirmed defect (why the guest reply's commit can come back nil for insert-image) needs a real-hardware repro with guest debug-pane capture, not attempted here.
davidwkeith
deleted the
claude/anglesite-issue-1422-image-asset-persist
branch
August 12, 2026 21:37
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
processImageDropwrites the optimized primary WebP + responsive variants underpublic/images/, butapply-edit-dispatcher.mjs'sonAppliedcall forinsert-image/replace-image-srconly ever passed{file, range}for the patched.astrosource — the asset bytes never made it into theanglesite/editscommit.{files: [...]}onAppliedshapeextract-componentalready established: the commit now lists the source file plus every assetprocessImageDropwrote.server/index-tools.mjs'sonAppliedwiring already branches onfilesgenerically, so no wiring change was needed there beyond a doc comment.replace-image-srcandinsert-imageasserting the actual git commit tree carries the asset files, not just the in-memoryfilesarray.Paired PR check
Anglesite/Anglesite(MCPonAppliedpayload shape consumers on the app side, plus a probe-script regression gate). insert-image applies in guest but never persists to host Source/ Anglesite#1422.Test plan
npm test(full vitest suite, 157 files / 3157 tests) passes.git ls-tree -ron the resulting commit contains both the source.astropatch and the optimized WebP assets.scripts/run-container-probe.shwith aninsert-imagegate exercising this end-to-end once this PR is tagged and vendored.Scope note
This addresses only the second of #1422's two defects (confirmed by inspection: missing asset bytes in the commit). The first defect — why the guest's
apply_editreply can come back with a nilcommitforinsert-imagein the first place — is unconfirmed and needs a real-hardware repro with guest debug-pane capture; not attempted here.🤖 Generated with Claude Code