t3code/support non-image chat attachments - #3927
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The specified base and head resolve to identical repository trees, with zero changed files or line changes. Despite the feature-oriented title, this PR has no runtime impact to review. Notes:
You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f044e403be
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7e248cb18
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a5cf3e282
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26a4c8e14f
ℹ️ 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".
26a4c8e to
2b01a69
Compare
There was a problem hiding this comment.
💡 Codex Review
t3code/apps/web/src/components/chat/ChatComposer.tsx
Lines 1926 to 1928 in 2b01a69
When the composer already has eight images, or the current drop reaches that limit, encountering one additional image executes this break and silently skips every later file in the same drop. This now incorrectly discards otherwise supported text attachments that happen to follow the excess image, even though the reported limit applies only to images; record the image error and continue scanning the remaining files instead.
ℹ️ 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".
|
I need this, plenty of times I want to give context to the chat and I had to copy the path manually in order to work, in codex cli automatically I can paste and it gives the filepath so the model can fetch it. |
2b01a69 to
58a0171
Compare
There was a problem hiding this comment.
Effect service conventions: two error-modeling issues in the new projects.writeTextAttachment path.
Posted via Macroscope — Effect Service Conventions
58a0171 to
2955bbd
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a36b386. Configure here.
|
Synced this branch to current upstream |

Verification
Summary
.t3/attachmentsand insert standard file-link chips into the promptWhy
The composer previously rejected every dropped file that was not an image. This made it impossible to attach Markdown, source, configuration, or other text files as agent context.
Text attachments now reuse the existing project file-writing and Markdown file-link paths, so they render and behave like other file references. Files are limited to 1 MB and rejected when they contain NUL bytes or invalid UTF-8.
The message collapse heuristic also now measures displayed link labels instead of their backing absolute paths. Without this, prompts containing several attachments could appear hidden even though their visible content was short.
Validation
pnpm exec vp test apps/web/src/components/chat/MessagesTimeline.test.tsxpnpm exec vp checkpnpm exec vp run typecheckNote
Medium Risk
Attachment ID format now includes a hash suffix, which can break stored IDs from older threads; attachment persistence and projection cleanup logic also changed in non-trivial ways.
Overview
The chat composer now accepts UTF-8 text files (drag, paste, or picker) in addition to images. Valid files are written under
.t3/attachmentsthrough a newprojects.writeTextAttachmentRPC, with server checks for UTF-8, non-empty content, and a contract-defined size cap (1 MB); the prompt gets standard file-link chips like other project references.Attachment identity and cleanup change: owned segments include a SHA-256 hash suffix (
toOwnedThreadAttachmentSegment) to avoid cross-thread slug collisions, and text attachments live as directories outside the workspace.runAttachmentSideEffectsis reworked to prune only thread-owned directory attachments without removing legacy image attachments still referenced elsewhere.Message collapse now measures visible markdown (
measureComposerMarkdownVisibleLength) so short prompts with long hidden attachment paths are not collapsed incorrectly.Reviewed by Cursor Bugbot for commit 1f2cbca. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add support for non-image chat attachments
This PR contains only blank line modifications. Despite the title indicating support for non-image chat attachments, no functional changes are present.
Macroscope summarized 1f2cbca.