Skip to content

fix(chat): make attached images addressable and stop silent attachment loss - #197

Merged
ABB65 merged 1 commit into
mainfrom
fix/chat-attachment-visibility
Aug 14, 2026
Merged

fix(chat): make attached images addressable and stop silent attachment loss#197
ABB65 merged 1 commit into
mainfrom
fix/chat-attachment-visibility

Conversation

@ABB65

@ABB65 ABB65 commented Aug 14, 2026

Copy link
Copy Markdown
Member

Neden

13 Ağustos staging konuşmalarının analizi (4 konuşma, hepsi görsel değiştirme akışı) tek bir kök nedene indi: model, ekli görselin URL/path'ini göremiyor (image bloğu piksel taşır). Ajan var olmayan UUID'ler ve Unsplash URL'leri uydurdu, gerçek kütüphaneye çöp asset yükledi; kullanıcı 10 görseli elle yükleyip path yapıştırmak zorunda kaldı. Üstüne composer'da üç sessiz ek-düşürme yolu + streaming-Enter yarışı, "görseli ekledim" denilen 4 mesajın sunucuya eksiz ulaşmasına yol açtı.

Ne değişti

Server

  • validateAttachmentBlocks her image bloğunun önüne referans satırı enjekte ediyor: kütüphane görseli → delivery URL + storage path + "upload_media çağırma" direktifi; ephemeral görsel → "adresi yok, asla uydurma"
  • Summary satırları artık attachment başına — blokları tamamen düşen ek, önceki ekten özet satırı miras almıyor (prompt, modelin göremediği bir görseli "ekli" diye bildirmiyor)
  • fetchLinkContent görsel URL'lerini kabul edip ephemeral context görseline çeviriyor (başka sekmeden sürüklenen görseller dahil)
  • Sistem prompt'u attachment bölümü storage path + ephemeral uyarısıyla hizalandı

Composer

  • Streaming sırasında Enter artık composer+tray+pinleri silip hiçbir şey göndermiyor
  • Yüklemesi başarısız ek: toast + chip kaldırılana dek send bloklu (sessiz eksiz gönderim imkânsız)
  • Kart tıklaması textarea'yı odaklıyor; send ve menü kapanışı sonrası odak iade — paste artık <body>'de kaybolmuyor
  • dataTransfer.items fallback'i; panel drop'ları text/uri-list kabul ediyor

Test

  • pnpm test tam süit yeşil (148 dosya / 1285 test); attachment-ingest testleri yeni sözleşmeyi pinliyor (descriptor satırları, per-attachment summary, image-URL link kanalı)

🤖 Generated with Claude Code

…t loss

Analysis of staging conversations showed every image-editing session
degrading the same way: the model receives image blocks as pixels only,
so a media-library attachment's URL was invisible to it — it invented
UUIDs and stock-photo URLs, or re-asked for something already provided.
Meanwhile the composer had three paths that dropped an attachment with
zero feedback, and Enter during streaming wiped the composer, the tray,
and the pinned chips while sending nothing.

Server:
- validateAttachmentBlocks injects a reference line ahead of each image
  block: library images carry their delivery URL + storage path and a
  do-not-reupload directive; ephemeral images state they have no address
  and must never get an invented one
- summary lines are now per-attachment — an attachment whose blocks were
  all dropped no longer inherits one, so the prompt cannot claim an image
  the model cannot see
- fetchLinkContent accepts image URLs (pasted or dragged from another
  tab) and converts them to ephemeral context images
- the system-prompt attachment section carries the storage path and the
  ephemeral warning, matching the in-message reference lines

Composer:
- Enter while streaming no longer falls through to a send that clears
  everything and delivers nothing
- a failed upload now raises a toast and blocks send until the chip is
  removed — no more messages that silently go out without their file
- clicking anywhere on the composer card focuses the textarea, and focus
  returns after send and after the attach menu closes, so paste lands in
  the input instead of vanishing on <body>
- paste falls back to dataTransfer.items when files is empty
- panel drops accept text/uri-list, so an image dragged from another
  browser tab attaches instead of navigating the page away
@ABB65
ABB65 merged commit df994df into main Aug 14, 2026
2 checks passed
@ABB65
ABB65 deleted the fix/chat-attachment-visibility branch August 14, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant