Keep recordings dropped from the macOS capture thumbnail
Summary
Dragging a recording from macOS's floating capture thumbnail could leave chat with a link to a file that macOS immediately deleted. Pin the dropped recording until the existing chat upload owner saves it, then return that saved path. The pane grants access to that exact saved file so its existing open, save, and drag actions continue to work.
Pending saves and retained grants belong to that chat. A real chat switch invalidates in-flight work; a new chat receiving its first session ID keeps its attachments.
Testing
- Managed native step
86c0f7358bb1b5c47fbfb1b5passed all 26 tests inAgentPaneRecordingDropTests,AgentPaneAttachDroppedTests,AgentPaneMediaDragTests, andAgentChatUploadsTestson exact heade6541632699d852a1a2402eb44590dc069fbfb30. - The tests-only commit
ad697b8d66da0fb1b797c1d65ba0d56e2a8228ffcompiled and reproduced the deleted-path failures in managed step7feb0909fcde93461dd553ae. - The corrected tests-only head
7a590a7929dc6767d2d84a85581cbaee1d8ca45ecompiled and reproduced both the late-save cross-chat leak and first-session attachment loss in step2c010db370b582de11e02c57. - Swift syntax, localization defaults, package groups, feature flags, and the NEXT prepush gate passed.
Observed / Not run
Observed deletion of the original recording before the request, retained bytes after deletion, subsequent media drag, exact-file access without sibling access, expiry, mismatched names, oversized/missing previews, refused saves, and session adoption during an awaited save in native tests. Independent and primary source reviews passed; required CI is still pending. No live floating-thumbnail drag was performed in an installed app. Visual recording previews are a separate change.
Changelog
Fixed: Recordings dragged from macOS's floating capture thumbnail remain available after the thumbnail closes.
Proof
No capture: this change preserves dropped file bytes and exact-file access without changing the attachment's appearance. Native lifecycle and file-boundary regression tests cover the behavior.
Agent session: cosmic-gray