Repository navigation
Conversation
… saved inline Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| name: attachment.name, | ||
| mimeType: attachment.mimeType, | ||
| sizeBytes: attachment.sizeBytes, | ||
| ...(attachment.source ? { source: attachment.source } : {}), |
There was a problem hiding this comment.
Preserving Snap Shot metadata broadens the attachment-persistence behavior implemented in this transport module. Could you move this persistence operation into the existing AttachmentUpload service and preserve source there, leaving the RPC handler to call the service and translate errors? Existing inline persistence is legacy, but new behavior should be added at the service boundary.
Posted via Macroscope — Effect Service Conventions
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Inline Snap Shot attachments now retain their existing captured-window metadata, matching the normal upload path. Image validation and file persistence remain unchanged, with no new capture or access behavior. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Merge current main and move inline attachment persistence into AttachmentUpload, preserving optional capture source metadata. Focused checks pass: 43 tests, affected typechecks, format, lint, knip and GraphQL.
|
This has been a draft with no activity for more than three days, so it is being closed: the open pull requests are kept to work that is ready to be looked at. Nothing is lost, the branch stays. When the work is ready, open a new pull request for it; this one will not be reopened. |
Problem
A Snap Shot image saved through
assets.persistChatAttachmentsloses its captured-window details (app name, window title, accessibility text). The agent's prompt then has no "captured-window data" block for that image, and the message no longer shows the Snap Shot details.The RPC's input and result types both carry the optional
source, but the handler builds each saved record without it. The original Snap Shot change (#8103) keptsourcein the V1 normalizer; the V2 rewrite (#2829) dropped it.On current main, the web queued-message edit sends newly added images as data URLs through this RPC. One way to hit it: take a Snap Shot, stash the draft, edit a queued message, restore the stash into the edit composer, and save. A web send that starts before the server config arrives also uses this path. Normal sends use pending uploads, which already keep
source.Change
Move the existing inline persistence operation into the
AttachmentUploadEffect service and preserve optionalsourcewhen constructing a saved attachment. The RPC handler delegates to that service. This addresses the Macroscope service-boundary review.Two service-level cases cover attachments with and without capture metadata and verify the persisted image bytes. Existing validation, IDs, errors, and concurrency are preserved.
Scope and approval
This is a very small, focused fix for an obvious bug, so there is no prior issue: the RPC contract accepts and returns
source, the server dropped it, and V1 kept it. The final change touchesAttachmentUpload.ts, its test, and the thin RPC handler inws.ts.Overlap search (open and closed PRs and issues): "persistChatAttachments", "snap shot", "SnapShotSource persist", "queued edit snap shot", "captured-window context". The closest is #32742 (Claude adapter MIME casing), which is a different defect in a different file.
Verification
source(expected undefined to deeply equal …); the same assertion passes with this repair.CI=true vp run check:changed: format, lint, knip, GraphQL, three affected package typechecks, and 43 tests passed in Boat.91bed2be-c9dc-4cb9-ba5e-5dee14fbd747, completed with no actionable findings on staged treee01bb864854cc1ac0c83c88d1b34ea40689a72f6. Reviewer inspected the source and verification logs; it did not rerun tests.c00a373491d20ebcef901b81170abfb9f5f757fe; the resulting candidate also merges cleanly with4f555c746ce3e762deb4a145bb87d8c7f8634aab.Original implementation by saphid with Claude Opus 5.5; recovery and service extraction with GPT-6.1 Sol/high in T3 Code.