feat(chat): support file attachments in messages send#694
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 4, 2026, 4:39 PM ET / 20:39 UTC. Summary Reproducibility: not applicable. this is a feature PR, not a bug report. Source inspection confirms current main has no Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the focused Do we have a high-confidence way to reproduce the issue? Not applicable: this is a feature PR, not a bug report. Source inspection confirms current main has no Is this the best way to solve the issue? Yes: using the generated Chat Media upload API and passing the returned AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 3d5c9cef65fa. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Add a repeatable --attach flag to `chat messages send` for uploading local files (e.g. images) alongside a message. Each file is uploaded via the Chat Media API to obtain an attachment data ref, then attached to the single Messages.Create call. --text becomes optional when at least one attachment is provided, so attachment-only messages are allowed. No new OAuth scope is required: the existing chat.messages scope already authorizes the upload endpoint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ca648b9 to
4c6675e
Compare
|
@clawsweeper re-review The previous automated review failed to complete (execution error, not a finding). Retrying as suggested. Both prior items are already addressed: the |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Adds a repeatable
--attachflag tochat messages sendfor uploading local files (e.g. images) alongside a message. Each file is uploaded through the Chat Media API to obtain an attachment data ref, then attached to the singleMessages.Createcall.--textbecomes optional when at least one attachment is provided, so attachment-only messages are allowed.No new OAuth scope is required — the existing
chat.messagesscope already authorizes the upload endpoint. Attachments render as image/file cards beneath the message (Chat's standard preview), not embedded inline in the text body.Verification
The Chat command test suite covers the upload→ref→attach flow, attachment-only sends, and the no-text/no-attach validation error.
make lintreports 0 issues.Also exercised live against the real Chat API — a two-attachment message posted successfully. Redacted server response (auth tokens in
downloadUri/thumbnailUristripped):{ "message": { "name": "spaces/REDACTED/messages/9WtvBkoxp3k.9WtvBkoxp3k", "thread": { "name": "spaces/REDACTED/threads/9WtvBkoxp3k" }, "createTime": "2026-06-04T19:09:42.621295Z", "sender": { "name": "users/REDACTED", "type": "HUMAN" }, "attachment": [ { "contentName": "20-e2etestcrs-FIXED-address-management.png", "contentType": "image/png", "source": "UPLOADED_CONTENT", "attachmentDataRef": { "resourceName": "REDACTED" }, "downloadUri": "https://chat.google.com/api/get_attachment_url?...&attachment_token=REDACTED", "thumbnailUri": "https://chat.google.com/api/get_attachment_url?...&attachment_token=REDACTED" }, { "contentName": "21-sbmmstestt-FIXED-address-management.png", "contentType": "image/png", "source": "UPLOADED_CONTENT", "attachmentDataRef": { "resourceName": "REDACTED" }, "downloadUri": "https://chat.google.com/api/get_attachment_url?...&attachment_token=REDACTED", "thumbnailUri": "https://chat.google.com/api/get_attachment_url?...&attachment_token=REDACTED" } ] } }Both files came back as
source: UPLOADED_CONTENT/contentType: image/png, confirming the upload→ref→attach path end to end.🤖 Generated with Claude Code