René's URL Explorer Experiment


Title: Bedrock invoke-model: gateway replaces every chat's model with the provider row's settings.model, so model configs silently run (and are priced as) the wrong model · Issue #29511 · coder/coder · GitHub

Open Graph Title: Bedrock invoke-model: gateway replaces every chat's model with the provider row's settings.model, so model configs silently run (and are priced as) the wrong model · Issue #29511 · coder/coder

X Title: Bedrock invoke-model: gateway replaces every chat's model with the provider row's settings.model, so model configs silently run (and are priced as) the wrong model · Issue #29511 · coder/coder

Description: Is there an existing issue for this? I have searched the existing issues Current Behavior Under the default Bedrock protocol (invoke-model), the AI gateway replaces the model in every request body with the provider row's settings.model (...

Open Graph Description: Is there an existing issue for this? I have searched the existing issues Current Behavior Under the default Bedrock protocol (invoke-model), the AI gateway replaces the model in every request body ...

X Description: Is there an existing issue for this? I have searched the existing issues Current Behavior Under the default Bedrock protocol (invoke-model), the AI gateway replaces the model in every request body ...

Opengraph URL: https://github.com/coder/coder/issues/29511

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bedrock invoke-model: gateway replaces every chat's model with the provider row's settings.model, so model configs silently run (and are priced as) the wrong model","articleBody":"### Is there an existing issue for this?\n\n- [x] I have searched the existing issues\n\n### Current Behavior\n\nUnder the default Bedrock protocol (`invoke-model`), the AI gateway **replaces the model in every request body with the provider row's `settings.model`** (or `settings.small_fast_model` when the requested id contains `haiku`). The chat's `model_config_id` decides only the display name and the price table. `aibridge/intercept/messages/base.go` `Model()` still does this on `main` today.\n\nConsequences we measured on a production deployment (v2.36.5, 2026-09-17):\n\n- A 6-hour Coder Agents delegation on a model config named \"Claude Fable 5\" (`global.anthropic.claude-fable-5`, 1,453 steps) ran **entirely on Sonnet 5**. CloudWatch `AWS/Bedrock` metrics by `ModelId` for the whole day show a single dimension, `global.anthropic.claude-sonnet-5`; no fable/opus id exists as a metric at all.\n- `GET /api/experimental/chats/{id}/cost` reported **$854** at the Fable config's prices. Real spend at Sonnet rates was ~$256. Every Opus- and Fable-labelled chat had been overbilled ~3.3× and nobody received the model they selected, since at least 2026-08-27.\n- Non-Anthropic configs on the same row (`openai.gpt-5.6-luna`, which was our default, `xai.grok-4.3`) were also silently Sonnet 5. Nothing in the UI, the chat, or the cost endpoint reveals the substitution.\n\nThe only workaround on `invoke-model` is **one Bedrock provider row per model** whose `settings.model` equals the config's model (we now run three identical-looking rows: Sonnet, Opus 5, Fable 5.1). The `mantle` protocol passes the model through, but Mantle does not yet serve every model (no `claude-fable-5-1`, no `gpt-6-astra` as of 2026-09-18), so it cannot replace the legacy path.\n\n### Relevant Log Output\n\n```text\n# CloudWatch AWS/Bedrock Invocations by ModelId, 2026-09-17 18:00Z – 2026-09-18 00:30Z\nglobal.anthropic.claude-sonnet-5   Invocations 2003   (only dimension present)\n\n# Coder cost for the Fable-labelled chat tree over the same window\n{\"total_cost_micros\":854160585,\"priced_message_count\":1453}\n\n# Provider row (no protocol → invoke-model)\n\"settings\": {\"_type\":\"bedrock\",\"_version\":1,\"model\":\"global.anthropic.claude-sonnet-5\",\n             \"small_fast_model\":\"global.anthropic.claude-haiku-4-5-20251001-v1:0\",\"region\":\"us-east-1\",\"role_arn\":\"...\"}\n```\n\n### Expected Behavior\n\nThe model a chat is pinned to is the model Bedrock is asked for, under every protocol. Concretely:\n\n1. **On `invoke-model`, send the config's model.** `settings.model` / `settings.small_fast_model` should only be a fallback when the request carries no model (Claude Code's `ANTHROPIC_MODEL` / `ANTHROPIC_SMALL_FAST_MODEL` use case), never an override of an explicit `model_config`. The chat daemon always knows the config's model, so it can pass it through; the `haiku`-substring heuristic should not apply to a request that already names a Bedrock inference profile.\n2. **Reject the mismatch instead of hiding it.** If the gateway must substitute, a model config whose `model` differs from what the provider row will send should fail validation on create/update (the same place #29112 already resolves inference-profile ARNs), and the chat should surface the substituted model in `messages[].usage` / the cost endpoint so pricing follows the model that actually ran.\n3. **Price what ran.** Cost should be computed from the model id the upstream response reports (Bedrock returns it), not from the config the chat was created with.\n\nAny one of these would have made the problem visible; (1) makes it go away without per-model provider rows.\n\n### Steps to Reproduce\n\n1. One Bedrock provider (default protocol) with `settings.model = global.anthropic.claude-sonnet-5`.\n2. Two enabled model configs on it: `global.anthropic.claude-sonnet-5` and `global.anthropic.claude-opus-5` (or any second Anthropic id), each with its own prices.\n3. Create a chat pinned to the Opus config, send one prompt.\n4. Look at CloudTrail `InvokeModelWithResponseStream` `resources[].ARN` or CloudWatch `AWS/Bedrock` by `ModelId`: the request went to Sonnet. `GET /chats/{id}/cost` priced it as Opus.\n\n### Environment\n\n- Coder v2.36.5+28c4c83 (same code on `main` as of 2026-09-18, `aibridge` `intercept/messages/base.go` `Model()`)\n- Provider type `bedrock`, `role_arn` auth, region us-east-1, protocol unset (`invoke-model`)\n- Coder Agents chats created via `POST /api/experimental/chats` with `model_config_id`\n\n### Additional Context\n\n- Workaround in use: one provider row per model (`bedrock`, `bedrock-fable`, `bedrock-opus`) with matching `settings.model`. It works but is invisible in the model editor and nothing warns when a config points at a row that will send a different model.\n- #28404 (Mantle, non-Anthropic models) and #29230 (reasoning-model override) improve the Mantle path, but deployments that need a model Mantle does not list still depend on `invoke-model`, where the substitution remains.\n- Related: #26734, #27361 (other cases of Bedrock model ids being reinterpreted silently).\n","author":{"url":"https://github.com/amaingot","@type":"Person","name":"amaingot"},"datePublished":"2026-09-18T02:38:48Z","url":"https://github.com/coder/coder/issues/29511"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bdda41cc-1c0d-dffe-2bdb-5153f746bdba
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB062:363D8E:2F7A8FB:3C39285:6B01ABAB
html-safe-nonce87cae7cccd2681d1714d8a3ed1f513f45d314b1658d622bfc193f8dd4ac4c456
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDYyOjM2M0Q4RToyRjdBOEZCOjNDMzkyODU6NkIwMUFCQUIiLCJ2aXNpdG9yX2lkIjoiMTEyMTgyNzAxNjkyMDkwMjU3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac80e55a149b5fab90b75d2881196396ce78c6d15e495aba442197cd0e58d8696b
hovercard-subject-tagissue:5495008831
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/29511/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a1823bb70d0fc5d98bc54d89efd984a0b8fc0c5b749727723ce9bddc4c861a3f/coder/coder/issues/29511
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a1823bb70d0fc5d98bc54d89efd984a0b8fc0c5b749727723ce9bddc4c861a3f/coder/coder/issues/29511
og:image:altIs there an existing issue for this? I have searched the existing issues Current Behavior Under the default Bedrock protocol (invoke-model), the AI gateway replaces the model in every request body ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameamaingot
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
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
disable-turbofalse
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
react-app-nameissues

Links:

Skip to contenthttps://github.com/coder/coder/issues/29511#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fissues%2F29511
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%2Fissues%2F29511
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=coder%2Fcoder
Reloadhttps://github.com/coder/coder/issues/29511
Reloadhttps://github.com/coder/coder/issues/29511
Reloadhttps://github.com/coder/coder/issues/29511
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
https://github.com/coder/coder
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/29511
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/29511
Bedrock invoke-model: gateway replaces every chat's model with the provider row's settings.model, so model configs silently run (and are priced as) the wrong modelhttps://github.com/coder/coder/issues/29511#top
https://github.com/dannykopping
Design Partner - Agents (Tier 1)https://github.com/coder/coder/issues?q=state%3Aopen%20label%3A%22Design%20Partner%20-%20Agents%20(Tier%201)%22
https://github.com/amaingot
amaingothttps://github.com/amaingot
on Sep 18, 2026https://github.com/coder/coder/issues/29511#issue-5495008831
feat: resolve bedrock inference profiles when a provider is written #29112https://github.com/coder/coder/pull/29112
feat: support non-Anthropic models on Bedrock Mantle #28404https://github.com/coder/coder/pull/28404
feat: add openai_config.reasoning_model override and bump fantasy #29230https://github.com/coder/coder/pull/29230
Support Bedrock application inference profile ARNs with underlying model capabilities #26734https://github.com/coder/coder/issues/26734
Model IDs with reserved provider prefixes (e.g. bedrock/...) are silently reinterpreted as canonical refs on non-gateway provider types #27361https://github.com/coder/coder/issues/27361
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Sep 18, 2026https://github.com/coder/coder/issues/29511#issuecomment-5724337223
Linear Codehttps://linear.app
ENG-3361https://linear.app/codercom/issue/ENG-3361
linear-codehttps://github.com/apps/linear-code
dannykoppinghttps://github.com/dannykopping
on Oct 6, 2026https://github.com/coder/coder/issues/29511#event-32614962985
linear-codehttps://github.com/apps/linear-code
Design Partner - Agents (Tier 1)https://github.com/coder/coder/issues?q=state%3Aopen%20label%3A%22Design%20Partner%20-%20Agents%20(Tier%201)%22
on Oct 8, 2026https://github.com/coder/coder/issues/29511#event-32814305724
https://github.com/dannykopping
dannykoppinghttps://github.com/dannykopping
on Oct 9, 2026https://github.com/coder/coder/issues/29511#issuecomment-6077912151
@amaingothttps://github.com/amaingot
https://github.com/dannykopping
dannykoppinghttps://github.com/dannykopping
on Oct 14, 2026https://github.com/coder/coder/issues/29511#issuecomment-6169338332
@amaingothttps://github.com/amaingot
Claude Platform for AWShttps://coder.com/docs/v2.38/ai-coder/ai-gateway/providers#claude-platform-for-aws
https://github.com/dannykopping
dannykoppinghttps://github.com/dannykopping
on Oct 23, 2026https://github.com/coder/coder/issues/29511#issuecomment-6358588811
dannykoppinghttps://github.com/dannykopping
not plannedhttps://github.com/coder/coder/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Oct 23, 2026https://github.com/coder/coder/issues/29511#event-34023254013
ethanndicksonhttps://github.com/ethanndickson
on Nov 3, 2026https://github.com/coder/coder/issues/29511#event-34987831553
fix: pick the Anthropic computer use tool version from the model on e…https://github.com/coder/coder/commit/ff40ec6900a82eeb254e38da08d5a2466ba006e7
ff40ec6https://github.com/coder/coder/commit/ff40ec6900a82eeb254e38da08d5a2466ba006e7
Sign up for freehttps://github.com/signup?return_to=https://github.com/coder/coder/issues/29511
Sign in to commenthttps://github.com/login?return_to=https://github.com/coder/coder/issues/29511
dannykoppinghttps://github.com/dannykopping
Design Partner - Agents (Tier 1)https://github.com/coder/coder/issues?q=state%3Aopen%20label%3A%22Design%20Partner%20-%20Agents%20(Tier%201)%22
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.