From fb9a261d61cc658207656758f5951852303db9a0 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Wed, 28 Oct 2026 14:39:03 -0700 Subject: [PATCH] fix(model-catalog): restore rejected rows through the store with_rejected_replaced still wrote the entries and names fields the store refactor removed, so 02 did not compile. It now inserts the bundled rows in one store edit, which rebuilds the name index Co-Authored-By: Claude Opus 5.5 --- .../crates/model-catalog/src/catalog.rs | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/litellm-rust/crates/model-catalog/src/catalog.rs b/litellm-rust/crates/model-catalog/src/catalog.rs index a2feff38716..409611fa5b6 100644 --- a/litellm-rust/crates/model-catalog/src/catalog.rs +++ b/litellm-rust/crates/model-catalog/src/catalog.rs @@ -369,22 +369,25 @@ impl Catalog { rejected.entry(key).or_default().push(error); } } - let rejections = rejected + let rejections: Vec<_> = rejected .into_iter() - .map(|(key, errors)| { - let bundled_entry = bundled.entries.get(&key).cloned(); - let replaced_by_bundled = bundled_entry.is_some(); - if let Some(entry) = bundled_entry { - catalog.entries.insert(key.clone(), entry); - } - Rejection { - key, - errors, - replaced_by_bundled, - } + .map(|(key, errors)| Rejection { + replaced_by_bundled: bundled.rows().entries.contains_key(&key), + key, + errors, }) .collect(); - catalog.names = name_index(&catalog.entries, &catalog.aliases); + catalog.store.edit(|rows| { + for rejection in rejections + .iter() + .filter(|rejection| rejection.replaced_by_bundled) + { + rows.entries.insert( + rejection.key.clone(), + bundled.rows().entries[&rejection.key].clone(), + ); + } + }); (catalog, rejections) }