Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Open
ibetitsmike wants to merge 3 commits into
mainfrom
mike/chat-model-reasoning-override
Open

feat: add openai_config.reasoning_model override and bump fantasy#29230
ibetitsmike wants to merge 3 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 f5b3f253c112 (feat(providers/openai): allow reasoning-model overrides and recognize gpt-6+ fantasy#57): 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.
  • 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.

Depends on coder/fantasy#57 merging; the pin then moves to the merged coder_2_33 commit. 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-11T13:50:52.520573Z bab4c83 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

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.

@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.

Automated review via Coder Agents

@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 Outdated
@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. (The docs/reference/api/schemas.md and chats.md reference pages and the engineering ARCHITECTURE.md are updated by this PR; only the conceptual models guide is missing the field.)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant