Stop falling back to older model availability announcements (#32316)

## What changed

Select the first model availability announcement in catalog order before
checking its display count. Once that announcement reaches its display limit,
show no announcement instead of falling back to a lower-priority model.

## Testing

- Update the model catalog test to verify that an exhausted higher-priority
  announcement does not expose an older announcement.

GitOrigin-RevId: 65f23b34e1ecb38934effd5305704d7ab2353492
This commit is contained in:
Eric Traut authored and copyberry committed 2026-07-11 03:01:18 +00:00
1 parent c9d52de5ca
commit 203d530cc6
2 files changed
+14 -19

No files matched your search

+2 -8
View File
@@ -96,7 +96,7 @@ fn select_model_availability_nux_picks_only_eligible_model() {
}
#[test]
fn select_model_availability_nux_skips_missing_and_exhausted_models() {
fn select_model_availability_nux_does_not_fall_back_to_older_announcement() {
let mut presets = all_model_presets();
presets.iter_mut().for_each(|preset| {
preset.availability_nux = None;
@@ -121,13 +121,7 @@ fn select_model_availability_nux_skips_missing_and_exhausted_models() {
&model_availability_nux_config(&[("gpt-5.4", MODEL_AVAILABILITY_NUX_MAX_SHOW_COUNT)]),
);
assert_eq!(
selected,
Some(StartupTooltipOverride {
model_slug: "gpt-5.4-mini".to_string(),
message: "gpt-5.4-mini is available".to_string(),
})
);
assert_eq!(selected, None);
}
#[test]