Skip to content

fix: align implicit settings with provider-selected models - #5425

Merged
jbeckwith-oai merged 5 commits into
mainfrom
fix/provider-selected-model-settings
Oct 27, 2026
Merged

jbeckwith-oai merged 5 commits into
mainfrom
fix/provider-selected-model-settings

Conversation

@jbeckwith-oai

@jbeckwith-oai jbeckwith-oai commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

This pull request fixes implicit model settings when a provider selects the model. A provider-selected non-GPT model no longer inherits GPT-5 reasoning and verbosity defaults, and routed strings such as any-llm/openrouter/openai/gpt-5.4-mini use the resolved adapter’s canonical defaults in both Agent.model and RunConfig.model.

Adapters expose defaults through Model.get_default_model_settings() while retaining their transport identifiers. Models without defaults retain settings captured at agent construction. Explicit settings remain authoritative, including equal-valued top-level assignments and settings shared by shallow clones. Plain explicit model names and concrete model selections retain their existing precedence. Sandbox capability settings follow model defaults, with run-level overrides last, in both Runner modes.

Resolves #5414.

Validation:

  • 252 focused tests passed (1 skipped), including both unresolved feedback regressions, adapter routing, settings serialization, cloning, and sandbox capability ordering.
  • Released API contract validation, formatting, lint, mypy, and Pyright passed.
  • Two consecutive clean adversarial review rounds on the final code.
  • Full local parallel suite: 12,379 passed, 33 skipped, and 69 failures matching the exact previously reproduced baseline set (checkout-path-sensitive MCP redaction assertions and sandbox snapshot defaults). The wrapper stopped before the serial group; local full verification is not green.

@jbeckwith-oai
jbeckwith-oai requested review from a team, rm-openai and seratch as code owners October 26, 2026 21:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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-10-27T02:13:15.874579Z b0df3be Manual request
🔒 Security Review ✅ Completed 2026-10-27T02:12:55.627594Z b0df3be 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: ed4afc64bc

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

dpiet-oai
dpiet-oai previously approved these changes Oct 26, 2026

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

I confirmed the existing AnyLLM defaults and explicit-settings regressions in both run modes using mocked model responses and the baseline resolver. These need addressing before approval. No additional inline findings.


Reviewed: ed4afc6 · Base: 0dc4cf1 · sdk-pr-review

@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: f81b0998ae

ℹ️ 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 src/agents/models/interface.py Resolved

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed f81b0998ae8eb9716d1c736e3d7a3be3590d19fa. The original AnyLLM prefix, explicit-settings and sandbox-capability cases are fixed. One P2 remains in the existing nested-provider routing thread: a supported route such as openrouter/openai/gpt-5.4-mini still reaches the defaults lookup with a provider prefix and loses the known model defaults. Canonicalize at the adapter boundary while preserving explicit Agent and RunConfig settings.

I reviewed the full changed source and the affected provider and sandbox paths. I did not execute candidate code. Hosted CI and the required human reviews remain separate gates.

@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: 4938bf2bfd

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

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

LGTM 👍 No changes requested.


Reviewed: 43875b2 · Base: 0dc4cf1 · sdk-pr-review

@jbeckwith-oai
jbeckwith-oai force-pushed the fix/provider-selected-model-settings branch from 43875b2 to 10a20ad Compare October 27, 2026 00:03

@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: 10a20ad245

ℹ️ 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 src/agents/agent.py Resolved
dpiet-oai
dpiet-oai previously approved these changes Oct 27, 2026
markstuart-oai
markstuart-oai previously approved these changes Oct 27, 2026

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 10a20ad245ae695683632e992a43e6bd48ec4758 after the rebase. The earlier provider-routing and unnamed-model findings are fixed; no new substantive findings in the complete 11-file diff.

Explicit routed-string defaults retain their existing behavior. Same-valued in-place assignment is not tracked by this identity/value design; explicit constructor settings or whole-settings replacement preserve that intent. I consider these stated scope boundaries acceptable for this provider-selected-model fix.

Source-only review with an independent pass; no candidate code or tests ran here. Hosted CI and the required human owner review remain separate gates.

marcuswood-oai
marcuswood-oai previously approved these changes Oct 27, 2026

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

LGTM 👍 No changes requested.

Explicit routed-string defaults are unchanged from the original base. Same-valued in-place assignments remain indistinguishable from untouched defaults; constructor settings or whole-settings replacement preserve explicit intent. These boundaries are acceptable for this provider-selected-model fix.


Reviewed: 10a20ad · Base: 16fdb20 · sdk-pr-review

@jbeckwith-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 4538ffe30f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 4538ffe30f

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

@jbeckwith-oai
jbeckwith-oai force-pushed the fix/provider-selected-model-settings branch from 4538ffe to b0df3be Compare October 27, 2026 02:10
@jbeckwith-oai

Copy link
Copy Markdown
Contributor Author

Rebased onto main at 9de261b as b0df3be without conflicts; all five PR patches are unchanged. There were no outstanding review threads or additional actionable comments. The new upstream sandbox example is included in 252 passing focused tests (1 skipped); two independent adversarial review rounds are clean. Formatting, lint, mypy, and Pyright passed. Full local tests had 12,379 passes, 33 skips, and exactly the same 69 previously confirmed baseline failures; the serial group was not reached. Hosted CI is running on this commit.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: b0df3bea9d

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@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: b0df3bea9d

ℹ️ 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 src/agents/model_settings.py Resolved

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

LGTM 👍 No changes requested.

Same-valued writes inside nested settings objects remain outside this fix. Top-level assignment or explicit ModelSettings preserves intent; I verified both alternatives in both run modes.


Reviewed: b0df3be · Base: 9de261b · sdk-pr-review

@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit a88d291 Oct 27, 2026
29 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the fix/provider-selected-model-settings branch October 27, 2026 04:16
@openai-sdks openai-sdks Bot mentioned this pull request Oct 27, 2026
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.

Agent with no model keeps GPT-5 default model settings when the model provider chooses the model

4 participants