fix: sync openclaw and hermes live provider updates (#5098)

* fix: sync openclaw live provider updates

* fix: sync hermes live provider updates

* fix test: hermes live import stores models as array after denormalize

The test import_hermes_providers_from_live_updates_existing_provider_from_live
seeded models as a dict, but import_hermes_providers_from_live reads via
get_providers() which calls denormalize_provider_models_for_read(), converting
models from YAML dict to UI-friendly array. The test assertion accessed models
as dict -> Null -> assertion failure.

Fix: access models as array by index, matching the actual storage format after
live import. Also verify the id field is preserved in the denormalized output.
This commit is contained in:
Allen Xu
2026-07-08 12:09:56 +08:00
committed by GitHub
parent e191af4aa1
commit e78aa8a7c3
3 changed files with 161 additions and 14 deletions
+4 -4
View File
@@ -689,16 +689,16 @@ pub fn run() {
}
match crate::services::provider::import_openclaw_providers_from_live(&app_state) {
Ok(count) if count > 0 => {
log::info!("Imported {count} OpenClaw provider(s) from live config");
log::info!("Synced {count} OpenClaw provider(s) from live config");
}
Ok(_) => log::debug!("○ No new OpenClaw providers to import"),
Ok(_) => log::debug!("○ No OpenClaw provider changes from live config"),
Err(e) => log::warn!("✗ Failed to import OpenClaw providers: {e}"),
}
match crate::services::provider::import_hermes_providers_from_live(&app_state) {
Ok(count) if count > 0 => {
log::info!("Imported {count} Hermes provider(s) from live config");
log::info!("Synced {count} Hermes provider(s) from live config");
}
Ok(_) => log::debug!("○ No new Hermes providers to import"),
Ok(_) => log::debug!("○ No Hermes provider changes from live config"),
Err(e) => log::warn!("✗ Failed to import Hermes providers: {e}"),
}