Skip to content

refactor(agents): tighten codex inline api fallback follow-up#39902

Merged
steipete merged 1 commit intomainfrom
fix/codex-inline-model-api-fallback-cleanup
Mar 8, 2026
Merged

refactor(agents): tighten codex inline api fallback follow-up#39902
steipete merged 1 commit intomainfrom
fix/codex-inline-model-api-fallback-cleanup

Conversation

@steipete
Copy link
Copy Markdown
Contributor

@steipete steipete commented Mar 8, 2026

Summary

Testing

  • pnpm check
  • pnpm build
  • pnpm test

@cursor
Copy link
Copy Markdown

cursor bot commented Mar 8, 2026

PR Summary

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.

@steipete steipete merged commit d91d24e into main Mar 8, 2026
11 of 12 checks passed
@steipete steipete deleted the fix/codex-inline-model-api-fallback-cleanup branch March 8, 2026 13:54
@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Mar 8, 2026
@steipete
Copy link
Copy Markdown
Contributor Author

steipete commented Mar 8, 2026

Landed via rebase onto main.

  • Gate: pnpm check && pnpm build && pnpm test
  • Land commit: b51de84
  • Merge commit: d91d24e

Follow-up cleanup for #39753.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 8, 2026

Greptile Summary

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.
  • No files require special attention.

Last reviewed commit: b51de84

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

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant