fix(config): drop retired skin/skin_options keys instead of validating them

A config.json written while the skin system existed can carry skin and
skin_options in any plugin section, and most plugin schemas set
additionalProperties: false. They are no longer core plugin properties;
RETIRED_PLUGIN_KEYS in schema_manager lists them and
drop_retired_plugin_keys removes them (unless the plugin's own schema
declares the name) in prepare_plugin_config, which loading, hot reload,
GET /plugins/config and both web saves already share, and in
validate_config_against_schema for callers that validate a raw section.
POST /plugins/config and /config/main also drop them from the stored
section they merge into, so they leave config.json on the next save.

Tests cover the load path (real PluginManager.load_plugin: no schema
warning, not degraded), raw and prepared validation,
validate_all_plugin_configs, and the JSON, form and /config/main saves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-09-23 09:58:06 -04:00
co-authored by Claude Opus 5.5
parent 46be239ec3
commit 21c05c9326
6 changed files with 261 additions and 34 deletions
+2 -3
View File
@@ -1276,9 +1276,8 @@ def _enhance_schema_with_core_properties(schema):
"""
Enhance schema with the core-owned per-plugin properties.
``enabled``, ``display_duration``, ``live_priority``, ``skin``,
``skin_options`` and the ``vegas_*`` tuning keys are system-managed and
always allowed, even when the plugin's schema doesn't declare them. The
``enabled``, ``display_duration``, ``live_priority`` and the ``vegas_*``
tuning keys are system-managed and always allowed, even when the plugin's schema doesn't declare them. The
list is ``schema_manager.CORE_PLUGIN_PROPERTIES``, the one validation uses,
so the save filter keeps exactly what validation accepts.
+6 -2
View File
@@ -1052,10 +1052,14 @@ def save_main_config():
if error:
return error
# Deep merge regular config into main config
# Deep merge regular config into main config, dropping
# retired core keys (skin, skin_options) from the stored section
from src.plugin_system.schema_manager import drop_retired_plugin_keys
stored_section = current_config.get(plugin_id)
current_config[plugin_id] = deep_merge(
stored_section if isinstance(stored_section, dict) else {}, regular_config)
drop_retired_plugin_keys(
stored_section if isinstance(stored_section, dict) else {}, schema),
regular_config)
if secrets_config:
plugin_secrets_updates[plugin_id] = secrets_config
+4 -1
View File
@@ -2190,7 +2190,10 @@ def save_plugin_config():
if plugin_id not in current_config:
current_config[plugin_id] = {}
current_config[plugin_id] = deep_merge(current_config[plugin_id], regular_config)
# Retired core keys (skin, skin_options) leave the stored section here
from src.plugin_system.schema_manager import drop_retired_plugin_keys
current_config[plugin_id] = deep_merge(
drop_retired_plugin_keys(current_config[plugin_id], schema), regular_config)
# Deep merge plugin secrets in secrets config
if secrets_config: