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

Skip to content

feat(providers/openai): allow reasoning-model overrides and recognize gpt-6+ - #57

Open
ibetitsmike wants to merge 2 commits into
coder_2_33from
mike/responses-reasoning-model-override
Open

feat(providers/openai): allow reasoning-model overrides and recognize gpt-6+#57
ibetitsmike wants to merge 2 commits into
coder_2_33from
mike/responses-reasoning-model-override

Conversation

@ibetitsmike

Copy link
Copy Markdown

Why

Bedrock Mantle and direct OpenAI both expose gpt-6-astra, but the fork's Responses client still classifies only gpt-5* (and o-series/codex) as reasoning models. For any newer generation it omits the reasoning parameter entirely (effort and summary are silently dropped) and forwards temperature, which OpenAI rejects with HTTP 400. Upstream charmbracelet#354 (cherry-picked here as-is) only widened the public IsResponsesModel/IsResponsesReasoningModel helpers; getResponsesModelConfig, which gates the request parameters, was left on gpt-5.

Every new model generation currently needs a fork release before chatd can use it correctly. Callers need a way to decide the classification themselves.

What

  • Cherry-pick upstream cfb0530 (fix: gpt series 6+ (#354)) unchanged.
  • getResponsesModelConfig treats gpt-5 and every later generation (gpt-6, gpt-10, ...) as reasoning models; -chat variants stay non-reasoning; gpt-4 is unchanged.
  • New provider option openai.WithReasoningModelFunc(fn func(modelID string) bool), mirroring WithResponsesAPIFunc: when set it replaces the built-in name heuristics for both the Responses client (reasoning params, temperature/top_p filtering, developer vs system role) and the Chat Completions client (WithLanguageModelReasoningModelFunc, including the logprobs/logit_bias filtering in DefaultPrepareCallFunc).

Validation

  • go build ./..., go test ./providers/openai/... -count=1, golangci-lint run ./providers/openai/..., gofumpt clean on touched files.
  • New tests: TestPrepareParams_ReasoningModelClassification, TestPrepareParams_ChatReasoningModelOverride (plus upstream's TestIsResponsesModel/TestIsResponsesReasoningModel). Mutation checks confirmed each assertion fails when the corresponding change is removed.
  • Live probe through the dev AI gateway with this branch: gpt-6-astra now sends reasoning: {"effort":"low"} without temperature and returns 200; forcing non-reasoning on gpt-5.6-luna via the new option sends temperature and gets OpenAI's 400, showing the override takes effect.

Follow-up: coder/coder will bump its pin and expose the override as an openai_config.reasoning_model model-config flag.

Xum acted on behalf of @ibetitsmike for this PR.

@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-11T11:54:06.960700Z f5b3f25 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.

@ibetitsmike

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: f5b3f253c1

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

Copy link
Copy Markdown
Author

Note on CI: the govulncheck job fails for reasons unrelated to this change. It reports stdlib advisories fixed in Go 1.26.6 (net/url, crypto/tls, encoding/xml; the workflow builds with 1.26.5 from go.mod) and golang.org/x/[email protected] reached only through providers/kronk. Both need a toolchain and dependency bump on coder_2_33, which is a separate chore. Build (3 OSes) and lint are green.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants