You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Low Risk
Small refactor in resolveModelWithRegistry plus a tightened regression test; behavior should be unchanged aside from better coverage of provider override propagation.
Overview
Simplifies resolveModelWithRegistry so inline-configured models only short-circuit resolution when they explicitly specify an api, ensuring forward-compat fallbacks still apply when api is omitted.
Extends the openai-codex regression test to assert provider-level baseUrl and headers are preserved when resolving the gpt-5.x forward-compat fallback.
Written by Cursor Bugbot for commit b51de84. This will update automatically on new commits. Configure here.
This PR is a two-part follow-up cleanup to #39753. In model.ts, the nested if (inlineMatch) { if (inlineMatch.api) { ... } } guard is collapsed into the equivalent if (inlineMatch?.api) optional-chaining form — no behavioral change at all. In model.test.ts, the existing regression test for issue #39682 is extended to also assert that a configured baseUrl and provider-level headers correctly survive the codex forward-compat path (i.e. they are propagated through applyConfiguredProviderOverrides even when the inline model entry lacks an explicit api).
Key changes:
model.ts line 163: if (inlineMatch?.api) replaces the two-level nested guard — semantically identical, fewer lines.
model.test.ts: adds headers: { "X-Custom-Auth": "token-123" } to the test fixture and asserts both baseUrl and headers appear in the resolved model, giving concrete coverage for the configuration-survives-forward-compat scenario.
Confidence Score: 5/5
Safe to merge — this is a pure refactor with no behavioral change and adds regression coverage.
This PR contains only safe changes: a semantically identical refactor of a guard condition and extension of an existing test to verify configuration propagation. The optional-chaining simplification is correct, and the test extension directly exercises the existing applyConfiguredProviderOverrides logic, validating that headers and baseUrl correctly flow through the forward-compat path. No logic changes, no edge cases missed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
baseUrland headers still survive the codex forward-compat pathTesting