mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-01 17:00:21 +08:00
fix: preserve model associations on refresh
This commit is contained in:
@@ -549,14 +549,6 @@ mod tests {
|
||||
.cloned()
|
||||
.collect())
|
||||
}
|
||||
|
||||
async fn delete_admin_provider_model(
|
||||
&self,
|
||||
_provider_id: &str,
|
||||
_model_id: &str,
|
||||
) -> Result<bool, Self::Error> {
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
||||
@@ -300,12 +300,12 @@ async fn gateway_model_fetch_updates_key_and_syncs_provider_model_whitelist_asso
|
||||
})
|
||||
.await
|
||||
.expect("provider models should load");
|
||||
assert_eq!(provider_models.len(), 1);
|
||||
assert_eq!(
|
||||
provider_models[0].global_model_name.as_deref(),
|
||||
Some("gpt-5")
|
||||
);
|
||||
assert_eq!(provider_models[0].provider_model_name, "gpt-5");
|
||||
let mut provider_model_names = provider_models
|
||||
.iter()
|
||||
.map(|model| model.provider_model_name.as_str())
|
||||
.collect::<Vec<_>>();
|
||||
provider_model_names.sort_unstable();
|
||||
assert_eq!(provider_model_names, vec!["gpt-4.1", "gpt-5"]);
|
||||
|
||||
execution_runtime_handle.abort();
|
||||
}
|
||||
@@ -526,11 +526,12 @@ async fn gateway_background_model_fetch_updates_key_and_syncs_provider_model_whi
|
||||
})
|
||||
.await
|
||||
.expect("provider models should load");
|
||||
assert_eq!(provider_models.len(), 1);
|
||||
assert_eq!(
|
||||
provider_models[0].global_model_name.as_deref(),
|
||||
Some("gpt-5")
|
||||
);
|
||||
let mut provider_model_names = provider_models
|
||||
.iter()
|
||||
.map(|model| model.provider_model_name.as_str())
|
||||
.collect::<Vec<_>>();
|
||||
provider_model_names.sort_unstable();
|
||||
assert_eq!(provider_model_names, vec!["gpt-4.1", "gpt-5"]);
|
||||
|
||||
let seen_plan = seen_execution_runtime_plan
|
||||
.lock()
|
||||
|
||||
@@ -236,16 +236,6 @@ impl ModelFetchAssociationStore for AppState {
|
||||
.await
|
||||
.map_err(|err| format!("{err:?}"))
|
||||
}
|
||||
|
||||
async fn delete_admin_provider_model(
|
||||
&self,
|
||||
provider_id: &str,
|
||||
model_id: &str,
|
||||
) -> Result<bool, Self::Error> {
|
||||
AppState::delete_admin_provider_model(self, provider_id, model_id)
|
||||
.await
|
||||
.map_err(|err| format!("{err:?}"))
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
||||
Reference in New Issue
Block a user