Real bugs from Macroscope and Bugbot, all verified against source:
- awaitAttachmentUploads consulted only live jobs, so an upload that
settled before the await lost its result and a ready image could drop
from a pick-and-send message. Terminal states are now kept in a
settled map that cancel/release clean up.
- Stashing cancelled in-flight uploads before the localStorage write was
confirmed; a quota failure stranded chips in uploading forever.
Cancellation now happens only after the write lands.
- Retargeting a draft to another environment overwrote a reload-restored
attachment's ready state with a dead failed state. The mismatch is now
derived (never written), so switching back recovers the attachment,
and re-uploads release the old environment's bytes first.
- The turn-start failure path restored chips from the pre-await
snapshot, resurrecting uploading states no job would ever advance.
- The "images were not attached" toast could fire when no message was
sent; it now waits for the turn to actually start.
- Removing a preview annotation or discarding a draft leaked the upload
and its server-side bytes; both now release like chip removal.
- Mobile paste drops now surface the needs-an-update banner instead of
a console.warn.
- Normalizer error mappings keep their PlatformError causes; the dead
unstructured AttachmentUploadRequestError is deleted; the sweep test
no longer reads the real clock (effect-diagnostics CI failure).
Also folds the rebase onto main: the new moveComposerPromptAndImages
draft-carry now merges the unified image list, and in-flight uploads are
retargeted to the destination draft so moved chips keep their progress.
Co-Authored-By: Claude Fable 5 <[email protected]>