René's URL Explorer Experiment


Title: fix: use one route-aware media rule for files and tool results by ethanndickson · Pull Request #31384 · coder/coder · GitHub

Open Graph Title: fix: use one route-aware media rule for files and tool results by ethanndickson · Pull Request #31384 · coder/coder

X Title: fix: use one route-aware media rule for files and tool results by ethanndickson · Pull Request #31384 · coder/coder

Description: Part of CODAGT-1430. Stacked on #31383. We had two rules for which media a model can take. AcceptsFilePartMediaType filtered user attachments, whilst ToolResultMediaOmission filtered tool results with its own lists, and only let images through on Anthropic. Now that fantasy converts tool result media like user files, the two should agree, so we'll keep one rule. chatprovider.Model now carries the configured provider type, and AcceptsFilePartMediaType reads a table keyed on the route, i.e. the configured provider plus the transport. replaceUnsupportedMedia applies it to user file parts and tool result media alike, including the pending tail of the turn prompt. As a result, tool result PDFs now reach Anthropic, and the 5 MiB inline image cap only applies to images. Azure OpenAI Chat Completions rejects file content parts with a 400 (This model does not support file content types, see Azure/azure-sdk-for-net#51873), and Gemini's OpenAI-compatible endpoint ignores them. chatd reaches both through the openai-compat client, so the rule rejects PDFs there, and the model gets a text note instead of a failed request or a silently dropped file. Unsupported tool result media now gets the same note fantasy writes ("The tool returned content, which cannot be displayed."), so the model sees one wording whichever layer drops it. I've also added a Tool results section to the MCP servers docs, and fixed the File attachments docs, which said every rejected attachment becomes text. Only text files do; a rejected PDF becomes a note that names it. I've also tested this end to end on Bedrock. I ran chatd from this branch with an Anthropic provider pointed at our AI gateway's Bedrock route (InvokeModel, us-east-2), plus an MCP tool that returns a PDF with a code word inside. Claude Haiku 5.5 and Claude Opus 5.5 (adaptive thinking) both read the code word from the tool result, and read it again on the next turn, when the PDF is replayed from history. The request carries the PDF as a document block inside tool_result, the same body chatd sends to Anthropic.

Open Graph Description: Part of CODAGT-1430. Stacked on #31383. We had two rules for which media a model can take. AcceptsFilePartMediaType filtered user attachments, whilst ToolResultMediaOmission filtered tool results w...

X Description: Part of CODAGT-1430. Stacked on #31383. We had two rules for which media a model can take. AcceptsFilePartMediaType filtered user attachments, whilst ToolResultMediaOmission filtered tool results w...

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

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:a688a3ea-7b08-fbde-3798-2048dbf234d8
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB15C:2D02CB:9E55A:D2807:6B015DE2
html-safe-nonce7de544c76e49079393ac574a30750bf19728eff52d8d63440b186953aefa9068
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTVDOjJEMDJDQjo5RTU1QTpEMjgwNzo2QjAxNURFMiIsInZpc2l0b3JfaWQiOiI4MzE2MjA5MjY3MDk0OTM3MDU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd027605d3227f5854a5d42b525e41d3e5abea8aa3a8988f01c9f8570f6c4db13
hovercard-subject-tagpull_request:5043837045
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/31384/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:altPart of CODAGT-1430. Stacked on #31383. We had two rules for which media a model can take. AcceptsFilePartMediaType filtered user attachments, whilst ToolResultMediaOmission filtered tool results w...
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/31384/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fpull%2F31384%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%2F31384%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/31384/files
Reloadhttps://github.com/coder/coder/pull/31384/files
Reloadhttps://github.com/coder/coder/pull/31384/files
coderhttps://github.com/coder
coderhttps://github.com/coder/coder
Codehttps://github.com/coder/coder
Issues320 (320)https://github.com/coder/coder/issues
Pull requests470 (470)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
codagt-1430-tool-result-filenamehttps://github.com/coder/coder/tree/codagt-1430-tool-result-filename
codagt-1430-media-rulehttps://github.com/coder/coder/tree/codagt-1430-media-rule
Conversation 17 https://github.com/coder/coder/pull/31384
Commits 6 https://github.com/coder/coder/pull/31384/commits
Checks 73 https://github.com/coder/coder/pull/31384/checks
Files changed https://github.com/coder/coder/pull/31384/files
Please reload this pagehttps://github.com/coder/coder/pull/31384/files
fix: use one route-aware media rule for files and tool results https://github.com/coder/coder/pull/31384/files#top
Show all changes 6 commits https://github.com/coder/coder/pull/31384/files
1431e32 fix(coderd/x/chatd): use one route-aware media rule for files and too… ethanndickson Oct 23, 2026 https://github.com/coder/coder/pull/31384/commits/1431e329500a5e09d8fe1537b9a820b99349d464
c3fffc8 docs(docs/ai-coder/agents/platform-controls): describe images and PDF… ethanndickson Oct 23, 2026 https://github.com/coder/coder/pull/31384/commits/c3fffc8209c5cf3424e64a22bffc1cf39db305fe
2a07a92 fix(coderd/x/chatd/chatprovider): send no PDFs on Azure and Google ro… ethanndickson Oct 28, 2026 https://github.com/coder/coder/pull/31384/commits/2a07a92cdc7fcb4f44eca202afdecf4037843e83
c9ba464 docs(docs/ai-coder/agents/platform-controls): name the providers that… ethanndickson Oct 28, 2026 https://github.com/coder/coder/pull/31384/commits/c9ba4648298edbc26e9fdc97edbaf4a2861ea357
4adfa18 docs: describe tool result media for every MCP server and rejected at… ethanndickson Oct 28, 2026 https://github.com/coder/coder/pull/31384/commits/4adfa180577c694f6dfc659dc6611d9491814d92
409b224 docs(coderd/x/chatd): describe the route media rule in ARCHITECTURE.md ethanndickson Nov 4, 2026 https://github.com/coder/coder/pull/31384/commits/409b224dd25d7728cbe90c4c6029925cc9d4f84d
Clear filters https://github.com/coder/coder/pull/31384/files
Please reload this pagehttps://github.com/coder/coder/pull/31384/files
Please reload this pagehttps://github.com/coder/coder/pull/31384/files
ARCHITECTURE.md https://github.com/coder/coder/pull/31384/files#diff-eeffa894733731941dfd60f3be77cfce5882b268fa9b6a6a99d9a6bda245bf29
chatd.go https://github.com/coder/coder/pull/31384/files#diff-9760d93414fe0e308947af4c1e3dc773ad63bdb871f2ed8fd433fae1124637db
chatfile_internal_test.go https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
chatprovider.go https://github.com/coder/coder/pull/31384/files#diff-844e8a8c2afe02596b5020e287bb0cb10ddf4cd674b98f03d06964e303d67ac2
file_parts_test.go https://github.com/coder/coder/pull/31384/files#diff-aa36904fa1cc5cc2b8a318041cdf9cee59b9234903c02126b77d369d143367cc
model.go https://github.com/coder/coder/pull/31384/files#diff-e2d43a662c888fcd8919b29f287eb2156cbb6aedfe09187fd15bc5812238c822
compaction_sanitize.go https://github.com/coder/coder/pull/31384/files#diff-5834db410b7278c99bff613a03bc5d5fe60c60cb458023799fcdde49c1f04d48
compaction_sanitize_internal_test.go https://github.com/coder/coder/pull/31384/files#diff-6c9504597e5e14bf9fc5051374a6bf46cafe784d60ff58d148d0f9308b1b452c
generation.go https://github.com/coder/coder/pull/31384/files#diff-dfd518003ddc50ff97f724f3fe144867eb2719d1e3e8796a68a245a579a1a75c
media_sanitize.go https://github.com/coder/coder/pull/31384/files#diff-afff881c22c3df33abb54a9215a210d0a45c62228b9f28396d0cb61c741d7ef3
media_sanitize_internal_test.go https://github.com/coder/coder/pull/31384/files#diff-70102a50913ffad384c2ecea4854d411678266dd66c2303c569d97455ee1ef6e
model_routing_aibridge.go https://github.com/coder/coder/pull/31384/files#diff-d56c44faebb0088b218ab5fff9b1d2508b39a82c800cac00da8681a78a71c043
tool_media_sanitize.go https://github.com/coder/coder/pull/31384/files#diff-a7a49e18816a80f1f9c067dcceccae8ad13ea171dc48ce765ccb92b11fa88a9c
tool_media_sanitize_internal_test.go https://github.com/coder/coder/pull/31384/files#diff-41d4df365c4eb293e7f5018a14c17986dd127a4af5b0f54e7f806c10fe57c773
turn_environment.go https://github.com/coder/coder/pull/31384/files#diff-7ea8547dd31cf097fdd9f086d3d8659b0ff3ced517650588284aadf91556b14f
turn_environment_internal_test.go https://github.com/coder/coder/pull/31384/files#diff-ccaf931030049b16f4f8e65ec360beafe8b07873e6fbc0fb419ca7b9b51b2677
index.md https://github.com/coder/coder/pull/31384/files#diff-e6fc4bd2630467259704b6545336a1e526ba0d5c670a5bffea38f184264a5497
mcp-servers.md https://github.com/coder/coder/pull/31384/files#diff-db5672077b786e5207c1663575505d56fb12f9235b45996d6938655867dee1b2
coderd/x/chatd/ARCHITECTURE.mdhttps://github.com/coder/coder/pull/31384/files#diff-eeffa894733731941dfd60f3be77cfce5882b268fa9b6a6a99d9a6bda245bf29
View file https://github.com/coder/coder/blob/409b224dd25d7728cbe90c4c6029925cc9d4f84d/coderd/x/chatd/ARCHITECTURE.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/31384/{{ revealButtonHref }}
https://github.com/coder/coder/pull/31384/files#diff-eeffa894733731941dfd60f3be77cfce5882b268fa9b6a6a99d9a6bda245bf29
https://github.com/coder/coder/pull/31384/files#diff-eeffa894733731941dfd60f3be77cfce5882b268fa9b6a6a99d9a6bda245bf29
https://github.com/coder/coder/pull/31384/files#diff-eeffa894733731941dfd60f3be77cfce5882b268fa9b6a6a99d9a6bda245bf29
https://github.com/coder/coder/pull/31384/files#diff-eeffa894733731941dfd60f3be77cfce5882b268fa9b6a6a99d9a6bda245bf29
coderd/x/chatd/chatd.gohttps://github.com/coder/coder/pull/31384/files#diff-9760d93414fe0e308947af4c1e3dc773ad63bdb871f2ed8fd433fae1124637db
View file https://github.com/coder/coder/blob/409b224dd25d7728cbe90c4c6029925cc9d4f84d/coderd/x/chatd/chatd.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/31384/{{ revealButtonHref }}
https://github.com/coder/coder/pull/31384/files#diff-9760d93414fe0e308947af4c1e3dc773ad63bdb871f2ed8fd433fae1124637db
https://github.com/coder/coder/pull/31384/files#diff-9760d93414fe0e308947af4c1e3dc773ad63bdb871f2ed8fd433fae1124637db
coderd/x/chatd/chatfile_internal_test.gohttps://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
View file https://github.com/coder/coder/blob/409b224dd25d7728cbe90c4c6029925cc9d4f84d/coderd/x/chatd/chatfile_internal_test.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/31384/{{ revealButtonHref }}
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
https://github.com/coder/coder/pull/31384/files#diff-28aa127310dbe3e870b9e60c2c3447d636af1288964d9f9664404089c53faf75
Please reload this pagehttps://github.com/coder/coder/pull/31384/files
Please reload this pagehttps://github.com/coder/coder/pull/31384/files
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.