Skip to content

fix: replace stale model catalog on provider switch - #2122

Merged
BigPizzaV3 merged 1 commit into
BigPizzaV3:mainfrom
hansen115566:codex/fix-stale-provider-model-catalog
Sep 9, 2026
Merged

fix: replace stale model catalog on provider switch#2122
BigPizzaV3 merged 1 commit into
BigPizzaV3:mainfrom
hansen115566:codex/fix-stale-provider-model-catalog

Conversation

@hansen115566

Copy link
Copy Markdown
Contributor

Summary

  • replace a stale Codex++-managed model_catalog_json when switching to a different provider profile
  • preserve genuinely external user-managed catalogs and the existing cc-switch takeover behavior
  • add a regression test covering an A6-style catalog being replaced by a three-model provider catalog

Problem

When config.toml points to a catalog generated for another Codex++ profile, apply_model_catalog_to_config treats the path like an external user-managed catalog. For custom Responses providers whose catalog already has the expected wire-format flags, copy_standard_responses_catalog reports no changes and the function returns without replacing the pointer. Codex then continues showing the previous provider's models after a provider switch and full restart.

Fix

Treat paths under Codex++'s managed model-catalogs directory as owned projections. If the existing managed path does not match the selected profile, remove the stale pointer and let the normal generation path create and select the current profile's catalog.

Validation

  • added apply_relay_profile_replaces_catalog_generated_for_another_profile
  • git diff --check passes
  • Rust tests were not run locally because Cargo is not installed in the test environment; CI should run the full suite

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.

2 participants