Repository navigation
fix(flow-chat): attach controller files and images in peer sessions - #3833
Merged
bobleer merged 2 commits intoNov 8, 2026
Merged
Conversation
Peer Device, remote workspace and detached sessions rejected every file dropped or pasted from the controller, and desktop drops only carry paths, so dragged images failed the same way. - Read controller files through the controller's own Tauri host (local provider marker), never through the rendered peer transport. The Linux clipboard fallbacks now read the controller clipboard too. - Send supported images as inline image contexts, which every execution host already accepts. - Stage other files with workspace_file_upload under openbitfun://runtime/<workspaceId>/attachments/<id>/, which agent tools on the host resolve. Gated by the new negotiated runtime_attachment_upload_v1 capability; older peers, folders and oversize files get an explicit message. - The upload service creates the runtime-owned parent for attachment URIs, confined to the runtime root.
…aces Follow-up for controller attachments in Peer Device Mode: - Fix the ChatInputImageIntake source contract: the WebKitGTK paste fallback now reads the controller clipboard, not the rendered device. - Move controller-local IO and the workspace_file_upload client into infrastructure/files/controllerFiles so the composer and Files panel share one implementation. - Files panel drop and OS-clipboard paste in Peer Device Mode published controller paths to the peer (paste_files / SSH upload) and read the peer clipboard. They now upload controller bytes with workspace_file_upload, using local-paste "name (1)" naming and never replacing a file. Folders are refused explicitly because the controller explorer listing filters entries; a cut behaves as a copy. - Report partial drop failures in the Files panel instead of dropping them silently. - Refuse .bfminiapp imports from controller paths while a peer is rendered instead of sending the path to the peer. - Give composer files without a session workspace their own message instead of the peer-update hint.
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
Peer Device sessions could not reference files from the controller device, and dragging an image into a remote-controlled session did nothing but show "A peer-device session cannot reference files from the controller device." Both come from the same gate:
resolveExternalFileIntakeAvailabilityrejected every controller path outside local execution, and desktop native drops only carry paths, so dropped images were rejected too (pasted images worked because they carry pixels).This makes controller attachments work in peer and remote sessions the way they do locally:
remoteConnectionId: ''), never through the rendered peer transport. The Linux clipboard fallbacks now read the controller clipboard instead of being proxied to the peer.upload_image_contexts). Works for Peer Device, remote workspace, and detached dispatch.workspace_file_uploadunderopenbitfun://runtime/<workspaceId>/attachments/<id>/<name>: host-owned runtime storage outside the repo that agent tools already resolve. The prompt references that host path, never a controller path.runtime_attachment_upload_v1peer capability (Desktop + CLI). The upload service creates the runtime-owned parent for attachment URIs, confined to the runtime root.Related gaps closed in the same pass (same root cause: a controller path or clipboard sent to the rendered peer):
paste_files/ SSH upload with controller paths, so the peer resolved them against its own disk, and paste read the peer's clipboard. They now upload controller bytes withworkspace_file_upload(local-pastename (1)naming, never replacing a file, 64 MB per file, cancellable). Folders are refused explicitly because the controller explorer listing filters hidden/ignored entries and would copy an incomplete tree; a cut clipboard behaves as a copy (the controller source is never deleted)..bfminiappimport (drag or picker) is refused while a peer is rendered instead of sending a controller path to the peer.infrastructure/files/controllerFiles.ts, shared by the composer and Files panel.Fixes #
Type and Areas
Type: bug fix / UI/UX
Areas: web UI (flow chat composer, Files panel, MiniApp import, peer device), Rust core (workspace upload service), stable contracts (peer host capabilities), locales, docs
Motivation / Impact
Remote-controlled sessions behaved differently from local ones: users could not drag or paste files or images from the device in front of them. After this change, dropping or pasting controller images and files into a Peer Device or remote workspace session attaches them as it does locally.
Remote scenarios:
runtime_attachment_upload_v1, explicit "update the peer device" reply otherwise.workspace_file_uploadrequires being signed in, so unsigned users get an explicit upload error for non-image files.Upgrade compatibility: new capability key is additive; a missing key resolves to unsupported on the controller. No persisted shapes change.
Verification
cargo test --locked -p openbitfun-product-domains --lib remote_surface::capabilities: 3 passedcargo test --locked -p openbitfun-core --no-default-features --features remote-connect --lib service::filesystem::upload: 3 passed (incl. new attachment-URI guard)pnpm --dir src/web-ui run test:run src/flow_chat/utils/externalFileIntake.test.ts src/flow_chat/utils/controllerFileTransfer.test.ts src/flow_chat/utils/imagePayload.test.ts src/infrastructure/peer-device/PeerConnectionManager.test.ts src/infrastructure/api/generated/remoteSurface.test.ts: all passedpnpm --dir src/web-ui run test:run(full suite): 1229/1229 files passed, incl. newworkspaceFileTransfer.peer.test.tsnpx tsc --noEmit(web-ui): clean; eslint on changed files: cleanpnpm run check:repo-hygiene: passedpnpm run i18n:audit: passed, 0 warningspnpm run capabilities:check: verifiedpnpm run fmt:rsNot yet exercised end-to-end between two real devices; remote behavior above is covered by unit tests only.
Reviewer Notes
Checklist