GeezerVison is showing github.com — WIP: feat: guests can attach images and small files by t3dotgg · Pull Request #24393 · pingdotgg/t3code
Conversation
t3dotgg
commented
Oct 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Guests could only type. Theo wants them to share small files, mostly screenshots, with the same approve-first flow as text.
Stacked on #24354.
How it works
- Guest composer. Paperclip button, paste, and drop, like the owner composer. Staged files show as thumbnails or file chips with a remove button. The page posts the message as multipart form data.
- Limits. Up to 4 files and 10 MB per message. Images must be PNG, JPEG, GIF, or WebP (the types the owner composer sends as images); any other non-image file goes as a file; other image types (SVG, HEIC) and empty files are refused. While messages wait, their files can total 20 MB per share. The page checks first; the server checks again: the multipart parser stops oversized or too-many-part bodies, then
GuestShareService.submit checks count, size, and type, and checks images by their first bytes so a renamed page never travels as an image. The 20 MB cap is in the decider, so it holds under concurrent submits.
- Storage. Files are stored with the existing attachment store as pending uploads and recorded on the waiting guest message (
ThreadGuestMessage.attachments, optional, so older clients decode it). Guest tokens still never enter SessionStore; every new capability is a GuestShareService method behind authorize.
- Owner. The waiting message shows the files on web and mobile with the existing attachment rendering (web: thumbnails that open the image viewer and file rows that open the file preview; mobile: the feed's own attachment list, now shared). Send runs through intake, which takes the guest's files from the share (never ones the client names), copies them into the thread like any upload, and dispatches a normal user message with the guest attribution.
- Cleanup. Dismissing or sending a message, closing the link, or replacing it enqueues the existing
attachment.cleanup effect for the pending uploads it leaves behind, so the files are deleted after the change commits. A sent message keeps the thread's copies. On expiry the files become unreachable to the guest at once (every guest route authorizes against the live share) and the existing pending-upload sweep deletes them a day after upload; guest submits now also trigger that sweep, which used to run only on owner uploads and startup. A message left waiting past a day loses its files, and Send then reports them missing.
- Guest access to files.
GET /api/guest/attachment?share=&id= serves only this share's waiting or sent files, or the thread's copies on the guest's own sent rows in the visible window. Never a dismissed message's files, another share's, or the owner's. Responses are no-store, nosniff, sandbox CSP; the four checked image types load inline and everything else downloads as application/octet-stream, so HTML and SVG never render. The stream keeps attachments only on guest-attributed messages (picked fields, no source).
Proof
- Server: limits (too many files, too many bytes, SVG, a fake PNG, an empty file) and that a refused message stores nothing; the 20 MB per-share cap; dismiss and close deleting files after the effect worker drains; a sent message carrying the guest's files with guest attribution and the guest loading the thread copy; a guest cannot load another share's file, the owner's file, or a missing id; intake replacing client-named files with the guest's copied files.
- Web: file limit checks, and a browser test that an attached file is posted as form data and leaves the composer.
vp run check:changed passes.
Not yet: before/after screenshots and a live tunnel pass.
Reviewed with sol-loop (GPT-6.1 Sol) over three rounds: a replacement link could read the previous guest's files, trimming of the share's message list; all fixed. (The item detail route it also covered was later removed with command output.) Files now follow the link recorded on the sent message. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+124
to
+128
|
|
const UPLOAD_LIMITS = Multipart.limitsServices({
|
|
|
maxParts: GUEST_MESSAGE_MAX_ATTACHMENTS + 4,
|
|
|
maxFileSize: GUEST_MESSAGE_MAX_ATTACHMENT_BYTES,
|
|
|
maxTotalSize: GUEST_MESSAGE_MAX_ATTACHMENT_BYTES + 64 * 1024,
|
|
|
});
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 High guest/http.ts:124
Multipart JSON attachments with filenames are parsed as fields, so parts.file is a string and Multipart.isPersistedFile filters the attachment out. The route can then return 204 after storing accompanying text without the attachment, or reject a JSON-only submission as empty. Set fieldMimeTypes: [] so named JSON uploads are parsed as files.
|
const UPLOAD_LIMITS = Multipart.limitsServices({ |
|
maxParts: GUEST_MESSAGE_MAX_ATTACHMENTS + 4, |
|
maxFileSize: GUEST_MESSAGE_MAX_ATTACHMENT_BYTES, |
|
maxTotalSize: GUEST_MESSAGE_MAX_ATTACHMENT_BYTES + 64 * 1024, |
|
}); |
|
const UPLOAD_LIMITS = Multipart.limitsServices({ |
|
maxParts: GUEST_MESSAGE_MAX_ATTACHMENTS + 4, |
|
maxFileSize: GUEST_MESSAGE_MAX_ATTACHMENT_BYTES, |
|
maxTotalSize: GUEST_MESSAGE_MAX_ATTACHMENT_BYTES + 64 * 1024, |
|
fieldMimeTypes: [], |
|
}); |
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/server/src/guest/http.ts around lines 124-128:
Multipart JSON attachments with filenames are parsed as fields, so `parts.file` is a string and `Multipart.isPersistedFile` filters the attachment out. The route can then return `204` after storing accompanying text without the attachment, or reject a JSON-only submission as empty. Set `fieldMimeTypes: []` so named JSON uploads are parsed as files.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This PR adds end-to-end guest image and file attachments across the web, mobile, server, orchestration, storage, and contracts layers, including a new authenticated download path and file-lifecycle behavior. An unresolved High-severity finding also reports that some multipart uploads can be silently omitted by the current parser configuration.
Needs human approval because:
- 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Thread transfer impact
✅ Thread transfer remains within every enforced ceiling.
ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.
| Provider |
Metric |
Main baseline |
This PR |
Impact |
PR ceiling |
|
| Codex |
Total thread wire |
— |
5.0 KiB |
— |
6.8 KiB |
✅ |
| Codex |
Thread snapshot wire |
— |
3.8 KiB |
— |
4.9 KiB |
✅ |
| Codex |
Live turn WebSocket wire |
— |
1.2 KiB |
— |
2.0 KiB |
✅ |
| Codex |
Live turn WebSocket decoded |
— |
20.9 KiB |
— |
29.3 KiB |
✅ |
| Codex |
Live turn messages |
— |
2 |
— |
8 |
✅ |
| Claude |
Total thread wire |
— |
5.0 KiB |
— |
6.8 KiB |
✅ |
| Claude |
Thread snapshot wire |
— |
3.8 KiB |
— |
4.9 KiB |
✅ |
| Claude |
Live turn WebSocket wire |
— |
1.2 KiB |
— |
2.0 KiB |
✅ |
| Claude |
Live turn WebSocket decoded |
— |
21.2 KiB |
— |
29.3 KiB |
✅ |
| Claude |
Live turn messages |
— |
2 |
— |
8 |
✅ |
Baseline: unavailable · PR result: fb0c837 · Source CI: failure
Scenario 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.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
A guest attaches files with the paperclip, paste, or drop: up to 4 files and
10 MB per message, images as PNG, JPEG, GIF, or WebP, other files as files.
The guest submit route takes multipart form data. The server checks count,
size, and type (images by their first bytes), stores the files as pending
uploads, and records them on the waiting message. Waiting files are capped at
20 MB per share.
The owner sees the files on the waiting message on web and mobile. Send copies
the guest's files, never ones the client names, into the thread and sends them
as a normal user message with guest attribution. Dismissing, sending, closing,
or replacing the share deletes the pending uploads after commit; anything left
is swept a day after upload.
A guest loads files only through a guest route that serves this share's own
waiting and sent files, no-store and nosniff, images inline and everything else
as a download.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XXL
1,000+ changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|