Skip to content

open every attachment type in a preview modal - #8655

Merged
Etherll merged 24 commits into
unslothai:mainfrom
mahiatlinux:feat/studio-attachment-preview-modal
Aug 22, 2026
Merged

Etherll merged 24 commits into
unslothai:mainfrom
mahiatlinux:feat/studio-attachment-preview-modal

Conversation

@mahiatlinux

@mahiatlinux mahiatlinux commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Clicking an attachment tile in chat only opened a lightbox for images. Documents, PDFs and audio had no way to see what was attached beyond the filename tooltip.

Every attachment kind now opens a modal:

  • images keep the existing chrome-free lightbox
  • audio plays through the existing AudioPlayer
  • anything text-bearing (txt, code, csv, html, pdf, docx, odt, ods) renders in a scrollable panel with the filename, size, line count and the source format the text came from

The text is the same extraction the adapters send to the model, so a composer preview shows exactly what the model will receive. The PDF, DOCX and HTML extractors move into features/chat/attachment-content.ts and the adapters in runtime-provider.tsx call them instead of keeping their own copy. A sent attachment no longer holds its File, so the preview unwraps the [PDF: name] header or <attachment name=...> tag the adapter wrote. Extraction starts on first open rather than on mount, and long files stop at 200k characters so a single <pre> cannot stall the webview.

AudioPlayer takes an optional filename so an attachment download keeps its own name instead of generated-audio.wav.

Testing

Manually verified in Studio: attached .txt, .csv, .html, .odt, .pdf and .docx in the chat composer and opened each tile. Every one shows its extracted text with the right size, line count and source-format label.

New unit tests in tests/attachment-preview-text.test.ts cover the wrapper round-trip ([PDF: ...] header, <attachment name=...> tag), the preview truncation cap, line counting and audio detection by MIME and extension.

tsc, eslint and biome check are clean on the touched files.

Extraction changes this pulled in

Opening the preview made two existing problems visible, so both are fixed here rather than left to the modal.

PDF and HTML text kept no line structure. unpdf's mergePages collapses \s+ to a single space and the HTML branch read body.textContent the same way, so a 250 KB PDF and an 8.9 KB page both previewed, and were sent to the model, as one line. PDF text is now joined per page and HTML walks block elements, both through one normalizer that collapses runs of spaces without folding newlines.

DOCX parts are bounded by what mammoth can inflate rather than by what the archive declares. jszip takes each part's size from the central directory and inflates it in full before anything can reject it, so a part declaring 1 KB and expanding to 1 GB exhausted the webview on a preview click. mammoth is now handed zipSync of fflate's unpack, and fflate allocates each entry at its declared size and stops there, so a lying part arrives truncated. The part set is still resolved the way findPartPaths resolves it, now off the same bytes mammoth reads.

Source files preview with syntax colours through the Streamdown code plugin the transcript already uses, under the shared MAX_HIGHLIGHT_CHARS ceiling. Text extracted from a document stays plain.

Clicking an attachment tile only opened a lightbox for images. Documents, PDFs
and audio had no way to see what was attached beyond the filename tooltip.

Every attachment kind now opens a modal: images keep the existing lightbox,
audio plays through AudioPlayer, and anything text-bearing (txt, code, csv,
html, pdf, docx, odt, ods) renders in a scrollable panel with the filename,
size, line count and the source format the text came from.

Text comes from the same extraction the adapters send to the model, so a
composer preview shows exactly what the model will receive. The PDF, DOCX and
HTML extractors move into features/chat/attachment-content.ts and the adapters
in runtime-provider.tsx call them instead of inlining their own copy. A sent
attachment no longer holds its File, so the preview unwraps the "[PDF: name]"
header or <attachment name=...> tag the adapter wrote. Extraction starts on
first open, not on mount, and long files stop at 200k characters.

AudioPlayer takes an optional filename so an attachment download keeps its own
name instead of "generated-audio.wav".
@mahiatlinux

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27ae1bd2aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +110 to +111
if (isPdfAttachment(name, contentType)) {
return { label: "PDF", text: await extractPdfAttachmentText(file) };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match preview extraction to the adapter that accepted the file

When a file's MIME and extension disagree, these extension-or-MIME checks can select a different extractor from the attachment adapter. For example, runtime-provider.tsx registers TextAttachmentAdapter before PDFAttachmentAdapter, so a report.pdf whose browser reports text/plain is sent to the model as plain text, but this branch attempts to parse it with unpdf and shows an error instead of the text the model receives. Reuse the adapter's resolved kind or apply the same precedence when choosing the preview extractor.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this. It needs a file whose extension and MIME disagree, which the browser does not produce for a real .pdf (it derives application/pdf from the extension). Matching the composite adapter's precedence would mean duplicating its accept-matching in the preview, which is more surface than the case is worth.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@mahiatlinux

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7cf1afffa8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +141 to +145
if (isPdfAttachment(name, contentType)) {
return { label: "PDF", text: await extractPdfAttachmentText(file) };
}
if (isDocxAttachment(name, contentType)) {
return { label: "DOCX", text: await extractDocxAttachmentText(file) };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bound PDF and DOCX files before extracting previews

When a user opens a large or highly compressed PDF/DOCX attachment in the composer, these branches still materialize the entire file and its extracted text before the 200,000-character display cap is applied; unlike OpenDocument files, the corresponding adapters impose no size limit. Clicking such an attachment can therefore freeze or exhaust the webview without sending it, so reject oversized files or use a bounded/worker-based preview extraction path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this. PDF and DOCX are container formats: a byte slice is not parseable, so there is no bounded read to do, and the same full-file extraction already runs in PDFAttachmentAdapter.send and DocxAttachmentAdapter.send when the message is sent. The preview adds no failure mode that sending does not already have; an upload size gate belongs in those adapters' accept path, which is outside this PR.

Comment on lines +153 to +158
if (isOpenDocumentAttachment(name, contentType)) {
const { label, text } = await readOpenDocumentAttachmentContent(
file,
name,
contentType ?? "",
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reuse the OpenDocument extraction already in progress

When a user clicks an ODT/ODS attachment in the composer, OpenDocumentAttachmentAdapter.add is already parsing and caching that file, but this branch starts an independent arrayBuffer read, synchronous unzip, DOM parse, and text extraction. For an allowed archive near the 50 MB limit this duplicates substantial main-thread work and memory—potentially concurrently if the tile is opened while upload status is still running—so expose/reuse the adapter's cached extraction rather than parsing the same document again for its preview.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this. The duplicate parse is extra work, not wrong output, and the adapter's cache is keyed by attachment id inside OpenDocumentAttachmentAdapter with no route to a React component. Threading an adapter instance through the preview for a repeat parse that is already capped at 50 MB is more surface than the case warrants.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 1101489a2b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member

Built two isolated Studios, one at this PR's merge base b3376300e and one at head 1101489a2, and drove the same Playwright scene against both: attach a 370 byte .txt to the chat composer, click the chip.

before and after

                        BEFORE            AFTER
preview_dialog_opened   false             true
dialog_text_chars       0                 370
dialog_title            null              unsloth-preview-fixture.txt
tile_label              Document attachment: unsloth-preview-fixture.txt   (same both sides)
attach_method           file_chooser      file_chooser

The control shot, the composer with the chip attached before any click, is byte-identical on the two sides, which is what makes the second shot mean something.

The thing most likely to be wrong here is not wrong

The preview text and the text actually sent to the model cannot drift. The extraction bodies moved out of the adapters into attachment-content.ts and the adapters now call the same functions, plain text is file.text() on both sides, and ODT/ODS goes through the same readOpenDocumentAttachmentContent. The only divergences are the bounded reads (1 MB byte slice for text and HTML, 200000 character display cap) and both surface as "preview truncated" in the dialog description. parseAttachmentText unwraps exactly the wrappers the adapters write.

I also expected the remove X to end up nested inside the new DialogTrigger. It does not: the dialog wrapper and AttachmentRemove are siblings inside AttachmentPrimitive.Root. No nested button.

Two real gaps, both about unbounded parsing on the main thread

  1. PDF and DOCX preview extraction has no size guard at all. attachment-content.ts lines 686 to 703 and 720 to 733 both call file.arrayBuffer() on the whole file and return truncated: false; only the plain-text and HTML branches go through readBoundedText, which checks file.size before the read, which is the right order. unpdf and mammoth are synchronous enough to freeze the webview on a large document. This is the same work the adapters' send already did, so it is not a new hazard class, but this PR makes it fire on clicking a thumbnail, without sending, and repeatably.

  2. DOCX is an unbounded decompression-bomb vector; ODT is not. extractDocxAttachmentText hands the raw arrayBuffer to mammoth with no bound on compressed or decompressed size. The OpenDocument path is properly guarded: open-document.ts caps the archive at 50 MB and each of content.xml / styles.xml at 10 MB decompressed, enforced in unzipSync's filter via entry.originalSize. DOCX deserves the same treatment.

Smaller

  • attachment-content.ts lines 742 to 749 re-parse the ODT archive from scratch for the preview while OpenDocumentAttachmentAdapter already holds the parsed result in this.content. Duplicated unzip plus XML parse on open. Not a correctness bug.
  • audio-player.tsx lines 24 to 32: audio.play() is called with no .catch() and setIsPlaying flips optimistically, so an unsupported codec leaves the button showing pause with an unhandled rejection, no onError on the element, and 0:00 / 0:00. Pre-existing, but before this PR the component only received Studio-generated wav and mp3; now it receives arbitrary user uploads.
  • An image attachment holds two object URLs at once, since AttachmentThumb and AttachmentPreviewDialog each call useAttachmentSource. Both are revoked, so it is waste rather than a leak.

Tests

studio/frontend $ npm test
tests 2032, pass 2032, fail 0
$ npx tsc -p tsconfig.test.json     exit 0

attachment-preview-text.test.ts covers parseAttachmentText (all three wrapper shapes plus the 200000 character cap and an unterminated tag), truncateAttachmentPreviewText, countAttachmentTextLines, attachmentAudioSrc across six MIME and extension combinations, and readAttachmentText's bounded slice for a 2 MB .txt and .html.

It leaves untested exactly the three branches from the findings above: PDF, DOCX and ODT in readAttachmentText, and the error path. The HTML tests stub DOMParser with querySelectorAll: () => [], so the script and style stripping never executes. use-attachment-source.ts is untested entirely. And there is no test asserting that the preview text equals the adapter's send output, which is the property the whole PR rests on: today it is guaranteed by shared code rather than pinned by a test.

Nice change, and the modal itself reads well.

danielhanchen pushed a commit to mahiatlinux/unsloth that referenced this pull request Aug 13, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

danielhanchen added a commit to mahiatlinux/unsloth that referenced this pull request Aug 13, 2026
@danielhanchen
danielhanchen force-pushed the feat/studio-attachment-preview-modal branch from 6ce75e0 to c3f91f6 Compare August 13, 2026 13:36
@danielhanchen

Copy link
Copy Markdown
Member

Took this over and pushed a commit bounding the document parsers. Re-ran the two-install evidence afterwards against the fixed head.

Before and after

Before: a non-image attachment was filename-only. Clicking the chip did nothing.

After: it opens a preview modal with the extracted text.

                        BEFORE            AFTER
preview_dialog_opened   false             true
dialog_text_chars       0                 370
dialog_title            null              unsloth-preview-fixture.txt

The control shot, the composer with the chip attached before any click, is byte-identical on the two sides, which is what makes the second shot mean anything. Real feature gap.

Cross-browser, driven against the real Studio: the modal opens with the full extracted text in Chromium, Firefox and WebKit alike. WebKit counts double here since Tauri uses the platform webview, WebKitGTK on Linux and WKWebView on macOS.

What I pushed

1. PDF and DOCX preview extraction had no size guard. Both branches called file.arrayBuffer() on the whole file and returned truncated: false; only the plain-text and HTML branches went through readBoundedText, which checks file.size before the read, which is the right order. unpdf and mammoth are synchronous enough to freeze the webview on a large document, and this PR made that fire on clicking a thumbnail, without sending, repeatably across attachments.

assertDocumentAttachmentSize(file, "PDF" | "DOCX") now runs before the arrayBuffer() in both extractors.

2. DOCX was an unbounded decompression-bomb vector; ODT was not. extractDocxAttachmentText handed the raw buffer to mammoth with no bound on compressed or decompressed size. The OpenDocument path was already guarded properly: open-document.ts caps the archive at 50 MB and each of content.xml / styles.xml at 10 MB decompressed, enforced in unzipSync's filter via entry.originalSize. DOCX now gets the same: an unzipSync pass with a filter that always returns false, so nothing is decompressed, rejecting any word/*.xml whose declared originalSize exceeds the ODT ceiling.

The two ceilings are the existing MAX_OPEN_DOCUMENT_* constants, now exported rather than newly invented, and deliberately not MAX_PREVIEW_TEXT_BYTES (1 MB), which would have refused ordinary 2 MB PDFs.

3. Audio. audio.play() had no .catch() and setIsPlaying flipped optimistically, so an unsupported codec left the button showing pause with an unhandled rejection, no onError on the element, and 0:00 / 0:00. Pre-existing, but before this PR the component only received Studio-generated wav and mp3 and now it takes arbitrary user uploads.

The guards live in the extractors rather than in readAttachmentText, so the send path in runtime-provider.tsx is bounded too, which is how the ODT path already behaved. An oversized document therefore surfaces through the dialog's existing error branch, "This file could not be read.", rather than a new message shape.

Does it break anything

Only in the intended direction, and the ceilings were chosen so ordinary files are unaffected: a normal PDF and a normal DOCX still extract, which the new tests pin as controls.

The thing most likely to have been wrong in this PR was not: the preview text and the text actually sent to the model cannot drift. The extraction bodies moved out of the adapters into attachment-content.ts and the adapters call the same functions, plain text is file.text() on both sides, and ODT/ODS goes through the same reader. The only divergences are the bounded reads (1 MB byte slice for text and HTML, 200000 character display cap) and both surface as "preview truncated" in the dialog description.

I also expected the remove X to end up nested inside the new DialogTrigger. It does not: the dialog wrapper and AttachmentRemove are siblings inside AttachmentPrimitive.Root. And parseAttachmentText cannot throw on a legacy payload shape: both regexes are anchored, applied to a 4096-character prefix, and use [^\n]*, so an unterminated <attachment> tag falls through to the plain-text branch.

Object URLs are created per open and revoked in the effect cleanup, including unmount-while-open. An image attachment holds two at once, since AttachmentThumb and the dialog each call useAttachmentSource, but both are revoked, so it is waste rather than a leak.

Tests

studio/frontend $ npm test                              2037 passed, 0 failed
studio/frontend $ npx tsc -b / tsc -p tsconfig.test.json  both exit 0

Five new cases, and they were checked against a stashed source tree so they actually bite:

✔ readAttachmentText refuses an oversized pdf before reading it
✔ readAttachmentText refuses an oversized docx before reading it
✔ readAttachmentText reads a pdf under the ceiling
✔ readAttachmentText lets a normal docx through to the extractor
✔ readAttachmentText refuses a docx that declares an oversized document.xml

# with the two source files stashed:
ℹ tests 19   ℹ pass 16   ℹ fail 3

The bomb test builds a real zip whose word/document.xml declares 11 MB but compresses to a few KB. The two control tests pass both ways.

Still not covered by tests

The PDF, DOCX and ODT branches of readAttachmentText beyond the new size guards, and the error path. The HTML tests stub DOMParser with querySelectorAll: () => [], so the script and style stripping never executes. use-attachment-source.ts is untested entirely. And there is still no test asserting the preview text equals the adapter's send output, which is the property this whole PR rests on: today it is guaranteed by shared code rather than pinned.

One thing to know before merging

This branch now conflicts with main in studio/frontend/src/components/assistant-ui/attachment.tsx. Main moved, not anything in this PR. Needs a rebase.

Nice change, and the modal reads well.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 13, 2026
@unslothai unslothai deleted a comment from mahiatlinux Aug 13, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 13, 2026
@Imagineer99 Imagineer99 self-assigned this Aug 17, 2026
@mahiatlinux mahiatlinux self-assigned this Aug 17, 2026
@mahiatlinux

mahiatlinux commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Before/after evidence for the preview modal, produced with scripts/pr_ui_diff.py: two isolated Studio installs, one at this PR's merge base 06c90e489 and one at head bcb79bd42, with the same Playwright scene driven against both. Server identity was checked per side off /proc, so the listener photographed as BEFORE runs with UNSLOTH_STUDIO_HOME=.../home_before and the AFTER one with .../home_after.

Both homes are fed the same two files, written from constants by the scene, so the size and the line count the dialog reports are properties of the build and not of the input: preprocess.py (938 B, 32 lines) and report.html (849 B). Both are attached in one pick and each tile is then clicked. No model is loaded and no GPU is used, since the text adapters gate on nothing.

Clicking the .py tile. On the base nothing happens: AttachmentPreviewDialog asks useAttachmentSrc() for a src, gets nothing for a document, and returns its children unwrapped, so the tile is a plain button.

preprocess.py preview

Clicking the .html tile. The description names the format the text was extracted from, and the text keeps its line structure.

report.html preview

Read off the two servers that were photographed:

BEFORE 06c90e489 AFTER bcb79bd42
tiles in the composer 2 2
[data-slot=dialog-content] nodes after a tile click 0 1
dialog title no dialog preprocess.py, report.html
description, preprocess.py no dialog 938 B · 32 lines
description, report.html no dialog 849 B · 18 lines · text extracted from HTML
extracted HTML text in the panel not shown 542 characters over 18 lines

The tile count is the control. Both halves attach both files, so the pair isolates what the click does rather than whether the attach worked.

Those 18 lines are the extraction change turning up in the evidence: the same 849 B read through body.textContent and a \s+ collapse is a single line, in the preview and in what the adapter sends, while here the headings and paragraphs land on their own lines. The .py line count matches the file exactly at 32.

Out of scene on purpose: the image lightbox and the audio player. AudioAttachmentAdapter.add refuses until an audio-input model is resident, so an audio tile needs real weights and a GPU, which this pair does not.

Downloadable copy. The same two composites plus the fixtures that produced them, published by a disposable workflow on the staging branch pr-8655-evidence-ci, so the files can be fetched rather than only viewed inline.

Run: https://github.com/mahiatlinux/unsloth/actions/runs/32025582308 (green)
Artifact: pr8655-evidence, 152 KiB zipped

  • pr8655_pair_00.png, the .py pair, 1544x876, 92,600 B
  • pr8655_pair_01.png, the .html pair, 1544x876, 74,909 B
  • fixtures/preprocess.py, 938 B, the exact file attached on both sides
  • fixtures/report.html, 849 B, the exact file attached on both sides

Both fixtures are byte-identical to what the two installs read, so 938 B · 32 lines and 849 B · 18 lines · text extracted from HTML can be reproduced from them by attaching the same files. The job re-asserts every byte count, the 32-line split and both image dimensions before it uploads.

@Imagineer99

Copy link
Copy Markdown
Member

Ran a targeted live A/B on the exact base (44afbdf) and this PR. The CI run reproduces the bug before the change in Edge—clicking a document opens no dialog—then passes on Windows Chrome, Windows Edge, and macOS WebKit after it.

The after-cases cover TXT, HTML, PDF, DOCX, ODT, truncation, oversized-file rejection with the draft preserved, and mobile dialog bounds. I also got 3,632/3,632 frontend tests plus typecheck/build locally. So the issue is real and I found no regression in the tested attachment paths.

Small cleanup before merge: the restricted deep import and unused audio blob URL are still worth addressing. Also, macOS here is Playwright WebKit, not branded Safari.

@Etherll

Etherll commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Fixed both attachment-preview findings in 0fb5837: PDF document proxies are now destroyed in a finally block after successful or failed extraction, and preview dispatch now shares the text adapter accept list and honors its precedence for text/plain files named .pdf, .docx, or .html. Validation: 59 attachment-focused tests passed; frontend typecheck and production build passed; targeted ESLint had 0 errors (3 existing react-refresh warnings). No full native browser modal journey was rerun.

@LeoBorcherding

Copy link
Copy Markdown
Collaborator

is it intentional that Html preview extracts the text instead of showing the actual html file contents?

The preview modal extracted an html file's rendered text, so the dialog
never showed the file itself. The html branch of readAttachmentText now
returns the raw bounded source with no label, and the html extensions
map to shiki's html grammar, so a page previews with syntax colours the
same way a python file does. The adapter still sends the extracted text
to the model, and a sent attachment keeps previewing that extraction.
@mahiatlinux

Copy link
Copy Markdown
Contributor Author

It was intentional at first: the preview mirrored the extraction the model receives. But you are right that for an HTML file the source is more useful, so as of 26e427c an HTML attachment previews as its raw markup with syntax highlighting, exactly like the Python preview. The adapter still sends the extracted text to the model, so opening a sent attachment keeps showing that extraction, which is the payload the model actually got.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 19, 2026
@mahiatlinux

Copy link
Copy Markdown
Contributor Author

@codex review

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 19, 2026
The desktop reliability contract pinned downloadUrl(src, "generated-audio.wav"), but audio-player.tsx now passes the attachment's own filename and keeps generated-audio.wav only as the default. Assert the new call shape and the preserved default instead.
@danielhanchen

Copy link
Copy Markdown
Member

Confirmed the extraction problem is real on main, where runtime-provider.tsx collapses PDF and HTML text to a single line before it reaches the model, so the fix is worth having. The direction is right, but this lands the preview modal, the extraction normaliser and the DOCX unpacking swap in one branch, so could you split the extraction fixes out first?

@mahiatlinux

Copy link
Copy Markdown
Contributor Author

@codex review

1 similar comment
@mahiatlinux

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 525d420d84

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Etherll Etherll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@Etherll
Etherll merged commit e0ae131 into unslothai:main Aug 22, 2026
45 of 46 checks passed
danielhanchen added a commit that referenced this pull request Aug 22, 2026
…9520)

attachment-content.ts imported OPEN_DOCUMENT_SPREADSHEET_MIME and
OPEN_DOCUMENT_TEXT_MIME from ./open-document, which exports neither. Both are
declared in ./open-document-accept; open-document.ts only imports the first of
them from there, so the name existed locally without being re-exported.

TS2459 and TS2305, so the frontend build fails on main and on every open pull
request that merges it.

#9455 and #8655 landed minutes apart. Each was consistent on its own branch and
neither could see the other.
@mahiatlinux
mahiatlinux deleted the feat/studio-attachment-preview-modal branch September 25, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants