René's URL Explorer Experiment


Title: feat(coderd/x/chatd): agent-created file attachments in chat by ethanndickson · Pull Request #24280 · coder/coder · GitHub

Open Graph Title: feat(coderd/x/chatd): agent-created file attachments in chat by ethanndickson · Pull Request #24280 · coder/coder

X Title: feat(coderd/x/chatd): agent-created file attachments in chat by ethanndickson · Pull Request #24280 · coder/coder

Description: Agents can already see workspace files and take screenshots, but users could not download those artifacts from chat. This PR adds durable chat attachments to chatd. attach_file, explicit computer screenshot actions (not the automatic post-action screenshots), and propose_plan now fetch bytes over the agent connection, store them in chat_files, link them to the chat, and carry attachment metadata in tool responses so buildAssistantPartsForPersist can materialize ordinary type:"file" assistant parts that the chat file APIs serve. The same storage helpers are reused for other artifact-producing paths. wait_agent recordings and thumbnails are stored as chat files and linked back to the parent chat, with best-effort relinking so parent chats retain those artifacts without leaving orphaned rows when chat-file caps reject links. storeChatAttachment wraps insert + link in one transaction, files are capped at 10 MB each and 20 per chat, and serving defaults to Content-Disposition: attachment with an explicit inline-safe allowlist. This PR also consolidates chat-file media policy in coderd/chatfiles. Uploads and tool-generated attachments share byte-based MIME detection, SVG blocking, inline-safety rules, and compatible text/plain refinement for JSON, CSV, and Markdown. Prompt construction still only inlines synthetic pasted text for model consumption; assistant-created attachments are persisted for the user and intentionally not replayed into later LLM turns. UI follow-up lives in #24281. Relates to CODAGT-91

Open Graph Description: Agents can already see workspace files and take screenshots, but users could not download those artifacts from chat. This PR adds durable chat attachments to chatd. attach_file, explicit computer s...

X Description: Agents can already see workspace files and take screenshots, but users could not download those artifacts from chat. This PR adds durable chat attachments to chatd. attach_file, explicit computer s...

Opengraph URL: https://github.com/coder/coder/pull/24280

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:90b8c7b1-57e7-225d-5f2d-d531f3632ec9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC41C:3E4205:16D4CDF:1E81655:6B014308
html-safe-nonce9f482d32e0dd2c219056541f9a4bc1619e29d915842331596e52295547c76653
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDFDOjNFNDIwNToxNkQ0Q0RGOjFFODE2NTU6NkIwMTQzMDgiLCJ2aXNpdG9yX2lkIjoiMzEyNzIyMjc1NzI0MzMwNjc2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc87b8bec55ef3fc01dc707a14df8952e2e8c0882820d70a7458b0d05718eda96
hovercard-subject-tagpull_request:3521089485
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/coder/coder/pull/24280/files
twitter:imagehttps://avatars.githubusercontent.com/u/39577870?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/39577870?s=400&v=4
og:image:altAgents can already see workspace files and take screenshots, but users could not download those artifacts from chat. This PR adds durable chat attachments to chatd. attach_file, explicit computer s...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/coder/coder git https://github.com/coder/coder.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id440752086
octolytics-dimension-repository_nwocoder/coder
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id440752086
octolytics-dimension-repository_network_root_nwocoder/coder
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/coder/coder/pull/24280/changes#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fpull%2F24280%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fpull%2F24280%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=coder%2Fcoder
Reloadhttps://github.com/coder/coder/pull/24280/changes
Reloadhttps://github.com/coder/coder/pull/24280/changes
Reloadhttps://github.com/coder/coder/pull/24280/changes
coderhttps://github.com/coder
coderhttps://github.com/coder/coder
Codehttps://github.com/coder/coder
Issues320 (320)https://github.com/coder/coder/issues
Pull requests468 (468)https://github.com/coder/coder/pulls
Discussionshttps://github.com/coder/coder/discussions
Actionshttps://github.com/coder/coder/actions
Projectshttps://github.com/coder/coder/projects
Security and quality49 (49)https://github.com/coder/coder/security
Insightshttps://github.com/coder/coder/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fcoder%2Fcoder%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcoder%2Fcoder%2Fissues%2Fnew%2Fchoose
ethanndicksonhttps://github.com/ethanndickson
mainhttps://github.com/coder/coder/tree/main
ethan/chat-file-attachmentshttps://github.com/coder/coder/tree/ethan/chat-file-attachments
Conversation 115 https://github.com/coder/coder/pull/24280
Commits 1 https://github.com/coder/coder/pull/24280/commits
Checks 34 https://github.com/coder/coder/pull/24280/checks
Files changed https://github.com/coder/coder/pull/24280/files
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
feat(coderd/x/chatd): agent-created file attachments in chat https://github.com/coder/coder/pull/24280/changes#top
Show all changes 1 commit https://github.com/coder/coder/pull/24280/files
cf835bc feat(coderd): agent-created file attachments in chat ethanndickson Apr 13, 2026 https://github.com/coder/coder/pull/24280/commits/cf835bcac4fd4e6eaa5e9fafa1d26f47f4cdd8d4
Clear filters https://github.com/coder/coder/pull/24280/files
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
mime.go https://github.com/coder/coder/pull/24280/changes#diff-40b0d2c2aef66f8d6c164fc3ef160f6c1333ec227903367774544f8497cb776d
mime_test.go https://github.com/coder/coder/pull/24280/changes#diff-1c9077ccb707e09c92d0be4e3c2ef1be40980c3d709891ab8196a4537bdc4570
exp_chats.go https://github.com/coder/coder/pull/24280/changes#diff-8e955e7c41dead7f4247d5779fea96cbf0a3c829549375a423cdc808a3cb8a2f
exp_chats_test.go https://github.com/coder/coder/pull/24280/changes#diff-7f0a3a4d3a58135df3e5c6658429ca020a5e473c7191760be6efcf490c7c5a63
attachments.go https://github.com/coder/coder/pull/24280/changes#diff-ce98d577e37acd3ed0f2f00a6a437e7a72c6a82ca7ec1cb551f8207d10192f80
attachments_test.go https://github.com/coder/coder/pull/24280/changes#diff-7bdd5b2e5329f51b8cc5eae5f080f04ed1532b919ffce47695c47a624248f847
chatd.go https://github.com/coder/coder/pull/24280/changes#diff-9760d93414fe0e308947af4c1e3dc773ad63bdb871f2ed8fd433fae1124637db
chatprompt.go https://github.com/coder/coder/pull/24280/changes#diff-efbd4568862067ed2049ae1ab9e16722cd4911231a6da66ce132cf824b23e967
chatprompt_test.go https://github.com/coder/coder/pull/24280/changes#diff-72cb61d521a06e71b70798ea0fa9e16e43a7add8b92fa5f299445a1dd4637261
attachfile.go https://github.com/coder/coder/pull/24280/changes#diff-65f5f27f2f2a5bea858fc58ec7d016f96310c964b5f40476aac56b9e46942e59
attachfile_test.go https://github.com/coder/coder/pull/24280/changes#diff-d71b7caed6f8ec3b39e942e0016617b73ee86eda29e6c2e362c1ff4189b7b433
attachment.go https://github.com/coder/coder/pull/24280/changes#diff-df22a38f5d463eb786a578a32a4b4db70f7ab133e3c366d954792086e3e6d568
computeruse.go https://github.com/coder/coder/pull/24280/changes#diff-1a07d64d368320c5d042dc301cfd8cbdf559553c0d369fa2f2374d07a265586b
computeruse_internal_test.go https://github.com/coder/coder/pull/24280/changes#diff-f9af163f5aa74321919159a5c012e6a6dfe8acaa8f18c2364843b361ec577cb1
computeruse_test.go https://github.com/coder/coder/pull/24280/changes#diff-e46fbe12e19bb7c9b0ffce63407296b1e25b749ee41bd6a6fcff0fb571041bfe
proposeplan.go https://github.com/coder/coder/pull/24280/changes#diff-a90361ab7c51a2e4cff570043d0a602d339a140cc37731817be754352af1e80e
proposeplan_test.go https://github.com/coder/coder/pull/24280/changes#diff-af79cb7b0e5138550a2099a025e925a89ea19cc049b929bfc948df070f3ba665
recording.go https://github.com/coder/coder/pull/24280/changes#diff-d9cc7f1300d8a25a128de8b0c78a0f14b3872ec28ab32f617372e1ca4da2cba8
recording_internal_test.go https://github.com/coder/coder/pull/24280/changes#diff-b344a2f64ff81ebf621b5a2b4b25f9ae4fe3b8206f2f52def92409c61c1e9170
store_chat_attachment.go https://github.com/coder/coder/pull/24280/changes#diff-906b246e4e7ef6a2f6cd1496375a849e45817e85cdf79e380589e56ebf4bea5e
store_chat_attachment_test.go https://github.com/coder/coder/pull/24280/changes#diff-5145b76489f87409f098f140164a7a1e61376cd0f17bca03c3c35a9139acbabd
subagent.go https://github.com/coder/coder/pull/24280/changes#diff-cdc0c9b50ef152b8c3271545d0e235809abee66ff64afa3833a2945d78bbaeac
subagent_internal_test.go https://github.com/coder/coder/pull/24280/changes#diff-e04a883d6f5ab02b9267703ba983fde54b8f95e5cc96fa1aad94cbf09850d254
chats.go https://github.com/coder/coder/pull/24280/changes#diff-897877136a20fe9613cd72c761f37a0fe0d71f4cf020fe929369b2e944ceea98
go.mod https://github.com/coder/coder/pull/24280/changes#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6
typesGenerated.ts https://github.com/coder/coder/pull/24280/changes#diff-0db594bd57651eba54a837eab00864ea5f931dfdf058eb3dc3b9e2e211fa6e7a
coderd/chatfiles/mime.gohttps://github.com/coder/coder/pull/24280/changes#diff-40b0d2c2aef66f8d6c164fc3ef160f6c1333ec227903367774544f8497cb776d
View file https://github.com/coder/coder/blob/cf835bcac4fd4e6eaa5e9fafa1d26f47f4cdd8d4/coderd/chatfiles/mime.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/24280/{{ revealButtonHref }}
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
Please reload this pagehttps://github.com/coder/coder/pull/24280/changes
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.