fix(core): support attachments without a File global#5097
Open
Kinfe123 wants to merge 2 commits into
Open
Conversation
🦋 Changeset detectedLatest commit: d6bc5a7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
I'll analyze this and get back to you. |
Contributor
|
Reviews (1): Last reviewed commit: "fix(core): support attachments without a..." | Re-trigger Greptile |
Kinfe123
force-pushed
the
fix/attachment-file-detection
branch
from
July 22, 2026 00:51
3c45608 to
6c0fb7d
Compare
Contributor
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Kinfe123
force-pushed
the
fix/attachment-file-detection
branch
from
July 22, 2026 01:00
6c0fb7d to
69e1419
Compare
autofix-ci
Bot
requested review from
AVGVSTVS96,
Yonom and
okisdev
as code owners
July 22, 2026 01:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CreateAttachmentvalues by their requiredcontentfield instead of the ambientFileconstructorExternalThreadattachment paths consistentglobalThis.Fileand files created by another constructor realmWhy
Calling
addAttachment()with a prepared attachment could throw before doing any work in React Native, Ink, Node, or other environments whereFileis unavailable. A browser file created in another window or iframe could also failinstanceof Fileand be misclassified as a prepared attachment.The new discriminator preserves the existing behavior for ordinary browser files and prepared attachments while removing the dependency on constructor identity.
Testing
pnpm testinpackages/core(584 tests)pnpm testinpackages/react(472 tests)pnpm --filter @assistant-ui/core buildpnpm --filter @assistant-ui/react buildpnpm lintpnpm changeset status --since origin/main --verbose