[excursion] Deduplicate persisted attachment IDs

Merged
TE
16d ago
+26-1

Codex excursion, unverified.

Summary

Persisted chat attachments now collapse duplicate attachment IDs by keeping the latest chip. Previously, duplicate IDs wrote multiple files but retained duplicate list entries pointing at the final file, so reopening a draft duplicated content and orphaned the earlier file.

Validation

  • git diff --check
  • Added ChatDraftAttachmentsTests.duplicateAttachmentIdsKeepOnlyTheLatestChip.
  • Swift tests and macOS app builds were not run locally; use the fleet compile-check.

No capture: persistence-only change.

Agent session: cosmic-gray


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Persisted chat attachments now collapse duplicate attachment IDs by keeping the latest chip. Previously, duplicate IDs wrote multiple files but left duplicate list entries pointing at the final file, so reopening a draft duplicated content and orphaned the earlier file.

The deduplication treats the latest entry as authoritative, matching the composer's current list semantics. Added ChatDraftAttachmentsTests.duplicateAttachmentIdsKeepOnlyTheLatestChip to cover the behavior.