Files
codex/codex-rs/models-manager
jif 2b84296288 Refresh the model catalog before turns after auth changes (#46508)
## Why

Credential changes can leave the in-memory model catalog associated with a different identity, causing subsequent turns to use bundled model metadata instead of the active credentials' catalog.

## What changed

- Refresh mismatched catalogs before user turns and mailbox-triggered wakeups, resolving lazy command credentials before comparing identities.
- Reuse a matching cache or fetch models with a five-second deadline covering auth resolution and cache access. Preserve fallback behavior on failure or timeout; static catalogs need no refresh.
- Recheck the active turn after discovery so an interrupted wakeup does not continue starting a turn.

## Testing

Add coverage for user and mailbox turns after credential rotation, including switching back after another identity replaces the shared catalog. Verify refreshed context windows and request behavior, fallback on discovery failure or auth timeout, and command-auth token rotation.

GitOrigin-RevId: 7e4ad25f1c4476e2023225731924af28c1181767
2026-09-18 23:26:12 +00:00
..