feat(desktop): attach images to a cloud workspace at create
Replaces #7632, which GitHub auto-closed when its base branch was deleted on merge. Same commit, recreated against main now that #7620 and #7622 have landed.
Desktop was worse than mobile here. Mobile refused with a visible error; desktop uploaded the files and then called create without them, so an attached image vanished with no signal at all. The reason was in a comment at the cloud branch of useSubmitWorkspace:
// Attachments stay behind — they are written to a host, and this
// workspace's host doesn't exist yet.
The change
An upload's target is now a host URL or CLOUD_UPLOAD_TARGET. For the cloud target the bytes go to cloud storage over a presigned PUT (attachment.createUpload) instead of to a host, and a ready entry carries a files.id the sandbox resolves rather than a host attachment id — the same id space mobile sends, which #7622 makes the box import on first boot.
The store already keyed uploads by (fileId, target), so the pill list, the pruning and the await path needed nothing. The only other change is the modal choosing the target when the destination is CLOUD_HOST_ID.
Attachments after this
| Create | Existing conversation | |
|---|---|---|
| Mobile | #7622 | already worked — materializeIntoWorkspace runs in the box |
| Desktop | this PR | already worked — setImagePasteOverride writes into the worktree for non-local hosts |
Verified
apps/desktoptypechecks clean on top ofmain; repo lint cleanbun teston the modal's tests: 4 pass / 0 fail- Not exercised against a real box yet — that needs the bundle publish + image release, which is the next step for all three together.
Summary by cubic
Fixes desktop cloud workspace creation so uploaded images are actually attached. Previously desktop uploaded the files and then created the workspace without them, silently dropping the attachments; now uploads go to cloud storage and the resulting file IDs are sent with the create request.
Notes
- Not exercised against a real sandbox yet; requires the bundle publish and image release.
Summary by CodeRabbit
- New Features
- Attachments added while creating cloud workspaces are now uploaded to cloud storage and automatically made available when the workspace sandbox starts.
- Cloud workspace creation now passes uploaded attachment information to the cloud agent.
- Attachment handling for local workspaces remains unchanged.