agent: Preserve saved model selection until provider loads (#59417)

This PR fixes a bug where a thread could fall back to a BYOK model when
a remote provider hasn't yet returned its list of available models. On a
cold start, a thread previously using a Cloud model would fall over to a
BYOK model (if a key is defined) because Cloud models aren't loaded yet.

Note: there is a small behaviour change here, where previously the
priority was `default_model → profile_model → default_model`. The new
order is `profile_model → default_model`.

Release Notes:

- Improved saved thread model selection for cloud-based providers
080838387aNeel committed on 6/18/2026, 6:27:21 PM· committed by GitHubparente45e42a
2 files changedLine totals unavailable