feat(web): preview document attachments in the file viewer #9292
Mergedjuliusmarmingemerged 2 commits into
main fromrefs/pull/9292/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/server/src/assets/AssetAccess.ts line 391Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -362,12 +362,15 @@362362 }363363 // Generic files carry their extension inside the attachment id (that364364 // shape resolves the on-disk path); images do not. Videos and images365- // render inline; other generic files download.365+ // render inline. Other generic files download unless a document viewer366+ // explicitly requested an inline response.366367 const isGenericFile = parseAttachmentFileExtension(input.resource.attachmentId) !== null;367368 const videoMimeType = input.resource.mimeType?.split(";", 1)[0]?.trim() ?? "";368369 const isVideo = INLINE_VIDEO_MIME_TYPE_PATTERN.test(videoMimeType);369370 claims = {370371 version: 1,371372 kind: "attachment",372373 attachmentId: input.resource.attachmentId,373- ...(isGenericFile && !isVideo ? { download: true } : {}),374+ ...(isGenericFile && !isVideo && input.resource.disposition !== "inline"375+ ? { download: true }376+ : {}),
juliusmarminge merged this7751299
juliusmarminge closed this
Sign in to join this conversation.


Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline:
dbc7bfa· PR result:807c0fe· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.