feat(companion): user β bot image attach/upload (completes images) - #422
Closed
claudiusthebot wants to merge 1 commit into
Closed
feat(companion): user β bot image attach/upload (completes images)#422claudiusthebot wants to merge 1 commit into
claudiusthebot wants to merge 1 commit into
Conversation
Completes image support (the send direction). The composer gains an
attach button; the picked image uploads to the bridge, renders inline in
the thread, and its saved path is handed to the model so it can read it.
Bridge/engine:
- server: POST /upload (raw binary body, 25 MB cap, binary-safe reader)
saves the file and returns { imagePath, path }. POST /send gains
optional imagePath + attachmentPath (SendOptions); text may be empty
when an image is attached.
- index: saveUpload() writes to the workspace uploads dir under a safe,
unique name; the upload handler registers it in the media map so it
serves back via /media. emitUser() can carry an imagePath (renders in
the thread; history keeps a "[photo]" placeholder). runTurn() appends
"[Attached image: <path>]" to the prompt so the model reads the file.
Client:
- file_picker dependency (chosen over image_picker for full desktop +
Android support, matching this app's targets). macOS entitlements gain
files.user-selected.read-only so the sandboxed build can read the pick.
- BridgeClient.uploadImage() + send() attachment args; AppState.uploadImage()
and sendMessage() attachment args.
- composer: attach button, a removable image preview chip, and a
pick β upload (spinner) β send flow. Send is enabled with text OR an
image; upload failures surface as a system note.
tsc + flutter analyze clean; native-frontend + bridge suites (25) pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
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.
What
Completes image support (#5) β the send direction. The composer gains an attach button; the picked image uploads to the bridge, renders inline in the thread, and its saved path is handed to the model so it can read it.
Bridge / engine
POST /upload(raw binary body, 25 MB cap, binary-safe reader) saves the file and returns{ imagePath, path }.POST /sendgains optionalimagePath+attachmentPath(SendOptions); text may be empty when an image is attached.saveUpload()writes to the workspace uploads dir under a safe, unique name; the upload handler registers it in the media map so it serves back via/media.emitUser()can carry animagePath(renders in-thread; history keeps a[photo]placeholder).runTurn()appends[Attached image: <path>]to the prompt so the model reads the file.Client
image_pickerbecause it supports every target this app ships to (Windows/macOS/Linux + Android);image_pickerhas no desktop-Linux/Windows impl. macOS entitlements gainfiles.user-selected.read-onlyso the sandboxed build can read the pick.BridgeClient.uploadImage()+send()attachment args;AppState.uploadImage()+sendMessage()attachment args.Test
tsc --noEmitclean Β·flutter analyze libβ No issues Β· native-frontend + bridge suites (25) pass.π€ Generated with Claude Code