From f67dbfe3e4abda72a4ea14762a2de143937b7a0b Mon Sep 17 00:00:00 2001 From: wcqqq1214 Date: Mon, 10 Aug 2026 22:58:23 +0800 Subject: [PATCH 1/2] fix: treat empty config schema as no config items --- astrbot/core/config/astrbot_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astrbot/core/config/astrbot_config.py b/astrbot/core/config/astrbot_config.py index e3e23b69d9..b393c0f503 100644 --- a/astrbot/core/config/astrbot_config.py +++ b/astrbot/core/config/astrbot_config.py @@ -57,7 +57,7 @@ def __init__( object.__setattr__(self, "_save_revision", 0) object.__setattr__(self, "_save_committed_revision", 0) - if schema: + if schema is not None: default_config = self._config_schema_to_default_config(schema) if not self.check_exist(): From 68e138bad089f70fc016a8db6e398585b6944f9f Mon Sep 17 00:00:00 2001 From: wcqqq1214 Date: Mon, 10 Aug 2026 23:19:00 +0800 Subject: [PATCH 2/2] docs: clarify empty schema handling --- astrbot/core/config/astrbot_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/astrbot/core/config/astrbot_config.py b/astrbot/core/config/astrbot_config.py index b393c0f503..de8490901b 100644 --- a/astrbot/core/config/astrbot_config.py +++ b/astrbot/core/config/astrbot_config.py @@ -57,6 +57,7 @@ def __init__( object.__setattr__(self, "_save_revision", 0) object.__setattr__(self, "_save_committed_revision", 0) + # An empty schema ({}) is falsy but valid: zero config items, not the global defaults. if schema is not None: default_config = self._config_schema_to_default_config(schema)