mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-07-09 17:08:29 +00:00
Fix model config snapshot sync
This commit is contained in:
parent
45a223dae0
commit
ff601d08d0
2 changed files with 12 additions and 1 deletions
|
|
@ -11,8 +11,11 @@
|
|||
x-effect="
|
||||
if (config && config !== lastConfig) {
|
||||
lastConfig = config;
|
||||
const snapshotBeforeInit = typeof context !== 'undefined'
|
||||
? context._toComparableJson(config)
|
||||
: null;
|
||||
$store.modelConfig.initConfigFields(config);
|
||||
if (typeof context !== 'undefined') {
|
||||
if (typeof context !== 'undefined' && context.settingsSnapshotJson === snapshotBeforeInit) {
|
||||
context.settingsSnapshotJson = context._toComparableJson(config);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,6 +118,14 @@ def test_model_config_frontend_tracks_inline_api_key_edits():
|
|||
assert "$store.modelConfig.resetApiKeyDrafts();" in modal_content
|
||||
|
||||
|
||||
def test_model_config_snapshot_sync_only_adjusts_clean_loaded_configs():
|
||||
config_path = PROJECT_ROOT / "plugins" / "_model_config" / "webui" / "config.html"
|
||||
config_content = config_path.read_text(encoding="utf-8")
|
||||
|
||||
assert "const snapshotBeforeInit" in config_content
|
||||
assert "context.settingsSnapshotJson === snapshotBeforeInit" in config_content
|
||||
|
||||
|
||||
def test_model_switcher_frontend_renders_custom_overrides():
|
||||
switcher_path = PROJECT_ROOT / "plugins" / "_model_config" / "webui" / "switcher-mixin.js"
|
||||
refresh_extension_path = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue