Skip to content

feat: add openai_config.reasoning_model override and bump fantasy - #29230

Merged
ibetitsmike merged 7 commits into
mainfrom
mike/chat-model-reasoning-override
Sep 16, 2026
Merged

ibetitsmike merged 7 commits into
mainfrom
mike/chat-model-reasoning-override

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The coder/fantasy fork classifies OpenAI reasoning models by name. The pinned version did not know gpt-6-astra, so the Responses client omitted the reasoning parameter (the reasoning effort picker did nothing) and forwarded temperature (quickgen title calls got HTTP 400 Unsupported parameter: 'temperature' and retried). Every new model generation would need a fork release to fix this. Admins need a switch in the model config instead.

What

  • Bump charm.land/fantasy to coder/fantasy a511353f83eb, the coder_2_33 commit that squash-merged feat(providers/openai): allow reasoning-model overrides and recognize gpt-6+ fantasy#57 (the pin also carries fix(providers/google): keep media tool results in the Gemini prompt fantasy#58, Gemini media tool results): gpt-6 and later generations are recognized as reasoning models, and the provider gains WithReasoningModelFunc to override the classification.
  • New tri-state openai_config.reasoning_model on ChatModelCallConfig: unset keeps fantasy's name heuristics, true forces reasoning-model handling (effort and summary sent, temperature/top_p dropped), false forces plain sampling. It is applied once at client construction next to use_responses_api. The generated model editor shows it for openai and bedrock providers, since Bedrock Mantle also serves OpenAI-format models; it is ignored for Anthropic models on Bedrock.
  • Remove the IsGPT6Astra transport fallback in chatopenai.UsesResponsesAPI; the bumped SDK recognizes gpt-6 itself (IsGPT6Astra stays for the effort clamp).
  • Regenerated API docs, swagger, TypeScript types, and the model options schema; ARCHITECTURE.md documents the flag.

Validation

  • New tests: TestChatModelCallConfig_ReasoningModelRoundTrip, TestModelFromConfig_OpenAIReasoningModelOverride (request body has reasoning and no temperature when forced on an unknown model; forced off on gpt-5 drops reasoning and keeps temperature; unset unchanged), TestAIGatewayModelBedrockReasoningModelOverride (Bedrock provider path), TestIsZeroChatModelCallConfigReasoningModel, and form-logic cases serializing the field for openai and bedrock. Red-green: removing the constructor wiring fails the request-body assertions.
  • go test ./coderd/x/chatd/... -count=1 (full), go test ./codersdk/... -run ChatModel, go test ./coderd/ -run 'ChatModel|Chats', golangci-lint run ./coderd/x/chatd/... ./codersdk/... ./coderd/ (0 issues), make gen (stable on rerun), Vitest for src/modules/aiModels and src/api/chatModelOptions (174 tests), Biome, tsc --noEmit, make pre-commit.
  • Remote dogfood UAT (Coder Agents) exercised the editor and chat on the dev AI gateway: the switch shows for OpenAI and Bedrock providers only, persists true/false/unset, and gpt-daybreak-blue-latest (an alias the SDK does not recognize) sends reasoning without temperature when forced on and gets OpenAI's temperature 400 when off or unset. UAT also found the new switch colliding with Use Responses API at 375px; tri-state switches now take the full row below sm. One open observation for follow-up: in Coder chats on gpt-6-astra the upstream stream carried no reasoning-summary events even though reasoning.summary=detailed was sent, while the same model returns summaries to a standalone fantasy client; not attributed to this change.
  • Merged origin/main (eceae296e8d; the only conflict was the ARCHITECTURE.md TODO block, resolved by keeping main's transport-selection prose and adding a TODO for the GPT-6 Astra sentence this PR makes stale) and moved the pin (553bfb86bf5). On that head: go build ./..., go vet ./coderd/x/chatd/... ./codersdk/, go test ./coderd/x/chatd/ -run 'ReasoningModel|TestAIGateway|Bedrock|ChatModelCallConfig|Quickgen|Transport', go test ./coderd/x/chatd/chatopenai/... ./coderd/x/chatd/chatprovider/... ./coderd/x/chatd/chatdebug/..., go test ./codersdk/ -run 'ChatModel|Reasoning', and the pre-commit hook on both commits. The providers/openai tree at a511353f83eb is byte-identical to the previously pinned PR head f5b3f253c112.
  • The local pre-push hook fails in this checkout only on unrelated tests (umask-dependent TestGetModulesArchive, two untouched site tests), so the push bypassed it; CI is the gate. For the pin-bump push the hook ran once in full (31,276 tests passed; the only 2 failures were TestGetModulesArchive, proven to be this checkout's 0600 file modes: passes after normalizing modes and on an untouched origin/main worktree) and was then opted out for this worktree per Mike's instruction.

coder/fantasy#57 is merged (a511353f83eb on coder_2_33) and the pin points at it. Related: #29229 (Bedrock reasoning_summary coercion).

Xum acted on behalf of @ibetitsmike for this PR.

Bump coder/fantasy to f5b3f253c112 (reasoning-model override hook, gpt-6+
recognized as reasoning models) and expose the hook as a tri-state
openai_config.reasoning_model model-config field, visible for openai and
bedrock providers, so new OpenAI model generations no longer need a fork
release to send reasoning parameters correctly.
@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-16T20:00:41.577743Z 63e04d6 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.

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@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: 6436db9941

ℹ️ 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
@ibetitsmike ibetitsmike changed the title feat(chatd): add openai_config.reasoning_model override and bump fantasy feat: add openai_config.reasoning_model override and bump fantasy Sep 11, 2026
The chatd guardrail reserves architecture prose for the human PR author.
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@coderagents

coderagents Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/ai-coder/agents/models.md - The "Provider-specific options > OpenAI" table enumerates the fields admins see in the model options UI. It does not yet list the new tri-state Reasoning Model field (reasoning_model). Add a row, e.g. "Override whether this OpenAI-format model is treated as a reasoning model. True sends reasoning effort and summary and drops temperature/top_p, false forces plain sampling, unset follows the model name." Consider noting it is ignored for Anthropic models on Bedrock. (docs/reference/api/schemas.md and chats.md are updated by this PR; only the conceptual models guide is missing the field.)

⚠️ A later commit (16c8db2a87) discarded this PR's coderd/x/chatd/ARCHITECTURE.md update, so the engineering architecture doc no longer documents openai_config.reasoning_model either, despite the PR description still saying it does.


Automated review via Coder Agents

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 729878f75b

ℹ️ 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".

The Advanced grid is two columns below sm and the on/off/default switch
cannot shrink below its labels, so the new Reasoning Model switch collided
with Use Responses API at 375px (found in remote UAT).
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: bab4c83832

ℹ️ 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".

Resolves the ARCHITECTURE.md conflict by keeping main's transport-selection prose, keeping the reasoning_model TODO, dropping the TODO that main's prose superseded, and adding a TODO for the GPT-6 Astra sentence this branch makes stale.
coder/fantasy#57 squash-merged into coder_2_33 as a511353f83eb. The openai provider is byte-identical to the previously pinned PR head f5b3f253c112; the new pin also carries coder/fantasy#58 (Gemini media tool results) and indirect x/image and x/text bumps that fix the govulncheck findings.

@johnstcn johnstcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A couple of doc TODOs need to be TODONE, but otherwise LGTM

Comment thread coderd/x/chatd/ARCHITECTURE.md Resolved
@ibetitsmike
ibetitsmike enabled auto-merge (squash) September 16, 2026 09:23
Resolve the add/add conflict in coderd/x/chatd/model_routing_internal_test.go
by keeping both appended tests (#29229's TestBedrockReasoningSummary and this
branch's TestAIGatewayModelBedrockReasoningModelOverride).
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 63e04d6b38

ℹ️ 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 merged commit 6c7f6b8 into main Sep 16, 2026
31 checks passed
@ibetitsmike
ibetitsmike deleted the mike/chat-model-reasoning-override branch September 16, 2026 20:09
@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