Repository navigation
Conversation
EclipseSourceAI
left a comment
There was a problem hiding this comment.
Note
Autonomous AI review. May contain mistakes.
Useful comment? React 👍. Disagree? React 👎 to reject it for follow-up reviews. A reply explaining why helps too.
This agent never approves PRs. A maintainer must sign off.
Only a maintainer can re-request a review from this agent.
Powered by Eclipse Enclave via review-guard-mcp
What it does: lets you attach a PNG or JPEG to a session in three ways: paste it into the prompt box, drop it on the session row, or use a new Attach image button. The daemon gets a POST {s}/image endpoint (raw bytes, 10 MiB limit, magic bytes checked) and an ImageAttacher provider interface, gated by a per-session attachImage capability. The Enclave provider runs enclave img import and then hands the image to the agent in one of two ways:
- sends
Ctrl+Vwhen the agent catalog's newimagePastefield lists the image's format; - otherwise types the image's path, without Enter.
Attaches are serialized per project. Enclave sessions also get an Image inbox setting in Container settings, which drift detection covers and adopted CLI sessions read back.
Where to focus:
provider/enclave/image.go: howattachImageis worked out from three sources: the contract check, the launch flags remembered at start, and the inventory listing. Missingoptionscounts as "may have the inbox".- The native paste relies on Enclave's paste window opening right after the import. That behaviour is in eclipse-enclave/enclave#230, which isn't merged yet, so re-check against the merged commit as the description says.
- The per-project lock is keyed by HomeShell's project ID. Enclave's inbox is per Enclave-resolved project, so two HomeShell projects that resolve to the same Enclave project would not serialize with each other.
Verification: I built the daemon and ran the demo UI. Attaching worked through the picker (single and multiple files), drag and drop, paste, a collapsed row and a waiting-state row. Text-only pastes and non-image files were handled correctly. The only visual issue was the collapsed-row status alignment (inline comment). I couldn't run the Go test suites here, and paste in the WebKitGTK and macOS desktop apps was not checked.
|
Thanks for the review.
|
EclipseSourceAI
left a comment
There was a problem hiding this comment.
Note
Autonomous AI review. May contain mistakes.
Useful comment? React 👍. Disagree? React 👎 to reject it for follow-up reviews. A reply explaining why helps too.
This agent never approves PRs. A maintainer must sign off.
Only a maintainer can re-request a review from this agent.
Powered by Eclipse Enclave via review-guard-mcp
Follow-up review. Checked the three threads I raised earlier against the code now on the branch, all three are genuinely fixed:
acceptsImageNow(state)now lives in@homeshell/model(types.ts) next tohasSessionRuntime/isSessionTerminal, matches the daemon'sCheckAttachable(idle/running only), and has a table test insession-display.spec.ts.session-row.tsxuses it.- The
rememberLaunchedImageInboxcomment now correctly distinguishes the cached vs. uncached case, and I confirmedsandboxFlagsFordoes return beforesandboxBasewhen the config carries no sandbox group, so the "configured" cases inTestAttachImageCapabilityOfALaunchdo exercise the uncached path as claimed. Keeping the lookup (treating unknown as "may have it") is the right call given the UX trade-off described. - The collapsed-row attach status now gets the same
0.75rem 0.5rem 2.1reminset as.rowNote, matching the preview underneath. I ran the new Playwright pixel-alignment test logic by hand against the CSS and it lines up; the component unit testnames the attached image in a brief status that clears itselfand the fullcomponents/modelunit suites (895 tests) pass.
Also reviewed 8f063ba (flaky timer test fix): the reasoning holds, the effect that starts the clear timer is pending when waitFor resolves on the upload text, so a synchronous advanceTimersByTime had no pending timer to fire. Switching to advanceTimersByTimeAsync inside an async act fixes it; verified by running the test, it passes reliably now.
No new issues found in the commits since my last review; they're narrowly scoped to the three fixes above. I couldn't run the Go test suite or the Playwright e2e suite in this environment (no Go toolchain), so I verified the Go-side logic by reading sessionconfig.go/enclave.go directly instead.
The per-project lock gap mentioned in my original review is explicitly deferred as a follow-up by the author (not a formal thread), that's a reasonable call given the design question attached to it.
These previous comments can be resolved as they are now handled:
acceptsImageNowextracted into the model package next to the other daemon state-rule mirrors- the stale comment about the launch always having asked Enclave for its config already
- collapsed-row attach status now lines up with the preview below it
I can't resolve them myself as I would need write permission on this repository.
POST {s}/image takes raw PNG or JPEG bytes (Content-Type image/png or
image/jpeg, at most 10 MiB) and answers with the image's path as the
session's agent sees it. Sessions whose provider implements the new
ImageAttacher interface declare the derived session capability
attachImage. Only idle and running sessions take an image: in waiting an
image could pick a menu option, and a starting agent may drop it.
The demo (fake) provider implements it, making up a /mnt/host-images/
path and echoing [image: <path>] into the session's preview.
A session declaring attachImage shows a paperclip button, "Attach image", beside its send box's Send. It opens a file picker for PNG and JPEG, several at once. The row drops any other file with "Only PNG or JPEG images can be attached", then uploads the rest one after another, in order, stopping at the first refusal. A success names the image in a brief status under the send box; failures go to the page's error line, like other session actions. The button is disabled, with a tooltip saying why, while the session is not idle or running (the daemon refuses an image then), while the daemon is unreachable, and while a batch is still uploading.
On a session declaring attachImage, pasting into its send box attaches the clipboard's image when the clipboard holds an image and no plain text; with any plain text it stays an ordinary text paste, so copying from a web page never uploads an image unexpectedly. Dropping image files on the session row attaches them, collapsed or expanded, and the row is outlined while files are dragged over it. Both go through the Attach image button's path: the same PNG/JPEG filter, ordered upload stopping at the first failure, status line and page error line. While the session takes no image (not idle or running, daemon unreachable, a batch still uploading) the row refuses the drag, outlined muted with the reason in its status line, and a paste reports the reason in the error line. The "Image attached" status now also shows on a collapsed row, so a drop there is confirmed.
Hand-checked on Ubuntu 24.04 (GNOME, Wayland; app run under XWayland for input) with WebKitGTK 2.52.6: an image paste gives the page types [Files] with empty files and items, and navigator.clipboard.read is undefined. Dropping and the Attach image button work.
WebKitGTK, the Linux desktop app's webview, reports a pasted image as type Files but hands the page no file, so the paste did nothing at all. A paste with no text that lists files but holds none now shows "Pasting images doesn't work here: drop the image on the row or use Attach image" in the page error line.
When the installed enclave has the image inbox, the Enclave Container settings get an "Image inbox" checkbox. It defaults to Enclave's image_inbox and its help says that every session of the project that has it on shares the inbox, and that it needs the Docker or Podman backend. Like the other booleans, it is passed only when it differs from the config (--image-inbox, or --image-inbox=false), replayed on restart, and read back from ps --json for adopted CLI sessions. Drift already compares every recorded option, so a change shows as outdated settings with no special case. Support is read from the contract check's own config --json answer (.options.image_inbox), kept per binary with its verdict, so no extra process runs. qemu is not modelled: Enclave's error shows on the session.
An Enclave session takes attached images when the installed enclave has the image inbox, HomeShell runs a bridge to it (not a foreground CLI session), and its recorded image inbox is on or unknown: image_inbox true in ps --json, or no options recorded at all. Until an inventory check lists a session HomeShell started or restarted, it goes by what its run resolved: the --image-inbox flag passed, else Enclave's config. An attach runs `enclave img import --session <container> --json -` in the session's working directory with the image on stdin, reads the path from the versioned image-import envelope, and types the path and a space into the agent's input through the bridge's new raw input, without Enter. A failed import's `error:` line is the 500 message. Attaches in one project run one at a time, import and delivery together. The e2e fixture learns img import --json and records the agent's input.
The agent catalog gains imagePaste: the image formats (png, jpeg) an agent takes as a native attachment when sent Ctrl+V. Claude Code and Pi paste PNG and JPEG, OpenCode PNG; every other agent, and any the user adds, pastes none. Catalog schema 2 fills these in for an existing agents.json, keeping a list already there. The field is editable through /api/agents and `homeshell agent add|set --image-paste`; a format other than png or jpeg is refused. An attach to an Enclave session now sends Ctrl+V right after the import when the session's agent lists the image's format, and the path and a space otherwise, as before. Neither submits, and the per-project lock still covers import and delivery. The e2e fixture can list extra Enclave tools, so the API e2e covers Claude Code (Ctrl+V), OpenCode with a JPEG (path) and a PNG (Ctrl+V), and Codex (path).
"names the attached image in a brief status that clears itself" failed on every run. The upload resolves outside act, so React renders the status text but leaves the effect that starts the clear timer pending. waitFor returned on the text, and the synchronous advance ran over a clock with no timer on it; the effect then scheduled a real one after the test. Advance with advanceTimersByTimeAsync inside an async act, which lets the pending effect run and its timer fire. The component was correct.
The session row checked for idle or running inline, a copy of the state rule in the daemon's CheckAttachable. It now calls acceptsImageNow from @homeshell/model, beside the UI's other copies of daemon state rules (hasSessionRuntime, isSessionTerminal), so the copy is named, documented against its daemon source and tested in one place.
rememberLaunchedImageInbox claimed the run had always asked for Enclave's config already. That holds only for a create or restart with a sandbox choice; without one the config was just forgotten and is asked for after `enclave run`. The comment now says so, and why the ask stays: skipping it would offer attaching to a session whose inbox is off until the next inventory check.
On a collapsed row, "Image attached: x.png" sat flush against the row's left edge while the output preview under it starts 2.1rem in. The row-level status now takes the inset the row's notes use; the one under the send box keeps its own alignment. A UI e2e pins the two left edges together.
What and why
Agents in Enclave sessions have no display and no clipboard, so a user can't show one a screenshot.
This lets you attach a PNG or JPEG to a session from HomeShell: paste it into the prompt box, drop
it on the session row, or pick it with the new "Attach image" button. HomeShell imports it into the
project's Enclave image inbox, then hands it to the agent without submitting, so your next
prompt goes with it:
Ctrl+V) for agents that paste the format: Claude Code and Pi (PNG, JPEG),OpenCode (PNG). The catalog's new
imagePastefield says which, and is user-editable.Closes #19.
Depends on eclipse-enclave/enclave#230 (
enclave img import, the image inbox), which is notmerged yet. This was built against its
fd004c4. On anenclavewithout the inbox, nothing hereshows: no setting and no attach controls. Re-check against the merged commit before merging this.
Per commit
802f5c3POST {s}/image(raw bytes, 10 MiB limit, PNG/JPEG checked by magic bytes) and theattachImagesession capability; the demo provider implements it.c57467f"Attach image" button in the session row; uploads in order, stops at the first failure.e8469f3,688d139,af98941Paste into the prompt box and drop on the row. In the Linux desktopapp, pasting an image doesn't work (WebKitGTK hands the page no file), so it now says to drop the
image or use the button instead. Recorded in
docs/ARCHITECTURE.md.add627b"Image inbox" checkbox in the Enclave Container settings, passed on start and restart,read back for adopted CLI sessions, and shown as outdated settings when changed.
1ef6150Enclave attach:enclave img import --session <container> --json -, path typed into theagent's input, Enclave's own error on failure, one attach per project at a time.
261bd26NativeCtrl+Vpaste per the agent catalog'simagePaste; catalog schema 2 fills inthe defaults for an existing
agents.json.b06f4d8Glossary: image inbox and attach (an image) inCONTEXT.md.Worth a look
path typed into a permission menu can pick an option.
a project run one at a time; an
enclave img importfrom a terminal at the same moment can stillslip in between (documented in
docs/PROVIDERS.md).imagePasteaccepts onlypngandjpeg. A hand-editedagents.jsonwith any other value failsto load, like other invalid rows.
Changelog
Checklist
AGENTS.md)AGENTS.md