Skip to content

fix(coderd/x/chatd): coerce Bedrock reasoning summaries to auto - #29229

Merged
ibetitsmike merged 3 commits into
mainfrom
mike/bedrock-reasoning-summary-auto
Sep 16, 2026
Merged

ibetitsmike merged 3 commits into
mainfrom
mike/bedrock-reasoning-summary-auto

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Bedrock Mantle's OpenAI Responses endpoint rejects reasoning.summary values other than auto with HTTP 400 (Unsupported parameter: 'reasoning.summary' is not supported with the 'openai.gpt-5.6-sol' model). chatd forwards provider_options.openai.reasoning_summary from the model config unchanged, so every chat turn and quickgen title call through a Bedrock model config carrying concise/detailed fails. On dogfood this produced 43 user-visible "chat generation failed" errors and 118 title-generation failures in one day; five Bedrock configs still carry detailed.

What

resolveModelCall now coerces provider_options.openai.reasoning_summary to auto for Bedrock providers whose model uses the OpenAI wire format (non-anthropic. model IDs), before per-call provider options are built. Mantle accepts auto (it returns no summaries today, but encrypted reasoning continuity keeps working). Coercing instead of dropping keeps one config portable between Bedrock and direct OpenAI, and summaries start flowing if AWS adds support. Anthropic models on Bedrock and every non-Bedrock provider are untouched. Only the derived provider options see the coerced value; the resolved call config keeps the configured one, so computer-use rerouting to direct OpenAI is unaffected. A TODO item in coderd/x/chatd/ARCHITECTURE.md marks the section for the human author, per the chatd guardrail.

Validation

  • TestAIGatewayModelBedrockReasoningSummary drives the real resolveModelCall path (newModel + ProviderOptionsForCall) with a request-capturing transport: Bedrock + openai.gpt-5.6-luna with detailed sends "summary":"auto"; Bedrock + Anthropic and direct OpenAI are unchanged. TestBedrockReasoningSummary covers the helper table. Red-green: removing the resolver call or the helper body fails the body assertion (expected "auto", actual "detailed").
  • go test ./coderd/x/chatd/ -run 'TestAIGateway|Bedrock', go test ./coderd/x/chatd/chatprovider/..., golangci-lint run ./coderd/x/chatd/... (0 issues), make pre-commit.
  • Remote dogfood UAT (Coder Agents) against a mock Bedrock upstream and the real OpenAI gateway: Bedrock openai.gpt-5.6-luna configs with detailed/concise/odd-cased values send "summary":"auto" and complete chats and titles; direct OpenAI keeps detailed with visible summaries; Bedrock Anthropic requests gain no OpenAI fields. UAT ran on the first head (a4878f8); the follow-up commit only stops the coerced config from leaking into provider substitution and swaps the doc paragraph for a TODO.
  • The local pre-push hook failed only on unrelated pre-existing failures in this checkout (provisioner/terraform TestGetModulesArchive hash mismatch from the host umask, two untouched site tests), so the push bypassed it; CI is the gate.

Related follow-ups: coder/fantasy#57 (gpt-6+ reasoning classification and an override hook) and a coder PR exposing an openai_config.reasoning_model flag in the model config UI.

Xum acted on behalf of @ibetitsmike for this PR.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-11T12:31:02.018388Z 88003b9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4878f88c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/ARCHITECTURE.md Resolved
Comment thread coderd/x/chatd/modelcall.go Resolved
Only the derived provider options see the Bedrock reasoning_summary
coercion, so computer-use rerouting to direct OpenAI starts from the
configured value. Replace the architecture prose with a TODO per the
chatd guardrail.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 88003b92ec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike enabled auto-merge (squash) September 16, 2026 09:23
@ibetitsmike
ibetitsmike merged commit e258526 into main Sep 16, 2026
28 checks passed
@ibetitsmike
ibetitsmike deleted the mike/bedrock-reasoning-summary-auto branch September 16, 2026 09:33
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants