Agent Zero AI framework
refactor: move allow_chat_override to top-level config and improve datetime parsing
frdel31ddee713ccf
diff --git a/extensions/python/banners/_20_missing_api_key.py b/extensions/python/banners/_20_missing_api_key.pyindex 14e7db5e8..7535712bf 100644--- a/extensions/python/banners/_20_missing_api_key.py+++ b/extensions/python/banners/_20_missing_api_key.py@@ -54,7 +54,7 @@ class MissingApiKeyCheck(Extension):})# Check preset providers for missing API keys (warning level)- if cfg.get("chat_model", {}).get("allow_chat_override"):+ if cfg.get("allow_chat_override"):preset_missing = []seen = set()for preset in cfg.get("model_presets", []):diff --git a/plugins/_model_config/default_config.yaml b/plugins/_model_config/default_config.yamlindex 544136026..0d56fa1c3 100644--- a/plugins/_model_config/default_config.yaml+++ b/plugins/_model_config/default_config.yaml@@ -1,3 +1,5 @@+allow_chat_override: true+chat_model:provider: "openrouter"name: "anthropic/claude-sonnet-4.6"@@ -9,7 +11,6 @@ chat_model:rl_input: 0rl_output: 0kwargs: {}- allow_chat_override: falseutility_model:provider: "openrouter"diff --git a/plugins/_model_config/extensions/python/initialize_migration_start/_10_migrate_model_config.py b/plugins/_model_config/extensions/python/initialize_migration_start/_10_migrate_model_config.pyindex 2e530c8ca..4137a0012 100644--- a/plugins/_model_config/extensions/python/initialize_migration_start/_10_migrate_model_config.py+++ b/plugins/_model_config/extensions/python/initialize_migration_start/_10_migrate_model_config.py@@ -51,6 +51,7 @@ class MigrateModelConfig(Extension):# Build plugin config from legacy settingsplugin_config = {+ "allow_chat_override": False,"chat_model": {"provider": raw.get("chat_model_provider", "openrouter"),"name": raw.get("chat_model_name", ""),@@ -62,7 +63,6 @@ class MigrateModelConfig(Extension):"rl_input": raw.get("chat_model_rl_input", 0),"rl_output": raw.get("chat_model_rl_output", 0),"kwargs": raw.get("chat_model_kwargs", {}),- "allow_chat_override": False,},"utility_model": {"provider": raw.get("util_model_provider", "openrouter"),diff --git a/plugins/_model_config/helpers/model_config.py b/plugins/_model_config/helpers/model_config.pyindex 0676d3834..78566f547 100644--- a/plugins/_model_config/helpers/model_config.py+++ b/plugins/_model_config/helpers/model_config.py@@ -127,8 +127,7 @@ def get_browser_http_headers(agent=None) -> dict:def is_chat_override_allowed(agent=None) -> bool:"""Check if per-chat model override is enabled."""cfg = get_config(agent)- chat_cfg = cfg.get("chat_model", {})- return bool(chat_cfg.get("allow_chat_override", False))+ return bool(cfg.get("allow_chat_override", False))def get_ctx_history(agent=None) -> float:diff --git a/plugins/_model_config/webui/config.html b/plugins/_model_config/webui/config.htmlindex 7b83e5996..e1547852b 100644--- a/plugins/_model_config/webui/config.html+++ b/plugins/_model_config/webui/config.html@@ -35,15 +35,15 @@</div><div class="field-control"><label class="toggle">- <input type="checkbox" x-model="config.chat_model.allow_chat_override" />+ <input type="checkbox" x-model="config.allow_chat_override" /><span class="toggler"></span></label></div></div>- <div class="override-presets-link" x-show="config.chat_model.allow_chat_override">+ <div class="override-presets-link" x-show="config.allow_chat_override"><button class="text-button" @click="openModal('/plugins/_model_config/webui/main.html')">- <span class="material-symbols-outlined" style="font-size:15px;">tune</span>+ <span class="material-symbols-outlined">tune</span><span>Edit Presets</span></button></div>diff --git a/plugins/_plugin_installer/webui/pluginInstallStore.js b/plugins/_plugin_installer/webui/pluginInstallStore.jsindex bd5906b01..73ea0bfa9 100644--- a/plugins/_plugin_installer/webui/pluginInstallStore.js+++ b/plugins/_plugin_installer/webui/pluginInstallStore.js@@ -654,7 +654,14 @@ const model = {formatUserLocaleDateTime(value) {if (!value || typeof value !== "string") return "";- const normalizedValue = /t/i.test(value) ? value : value.replace(" ", "T");+ const trimmedValue = value.trim();+ const hasExplicitTimezone = /([zZ]|[+-]\d{2}:?\d{2})$/.test(trimmedValue);+ let normalizedValue = /t/i.test(trimmedValue) ? trimmedValue : trimmedValue.replace(" ", "T");++ if (!hasExplicitTimezone && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?$/.test(normalizedValue)) {+ normalizedValue = `${normalizedValue}Z`;+ }+const date = new Date(normalizedValue);if (Number.isNaN(date.getTime())) return value;