From ecc6e8dccde07a9773c1327e04c6e369b037a692 Mon Sep 17 00:00:00 2001 From: L1ngg <2157878170@qq.com> Date: Mon, 2 Mar 2026 19:12:11 +0800 Subject: [PATCH 1/2] fix(core): correctly parse DEMO_MODE as boolean from env var. --- astrbot/core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astrbot/core/__init__.py b/astrbot/core/__init__.py index 6400d6fa44..24f73071be 100644 --- a/astrbot/core/__init__.py +++ b/astrbot/core/__init__.py @@ -14,7 +14,7 @@ # 初始化数据存储文件夹 os.makedirs(get_astrbot_data_path(), exist_ok=True) -DEMO_MODE = os.getenv("DEMO_MODE", False) +DEMO_MODE = os.getenv("DEMO_MODE", "False").lower() in ("true", "1", "t") astrbot_config = AstrBotConfig() t2i_base_url = astrbot_config.get("t2i_endpoint", "https://t2i.soulter.top/text2img") From dd91a2a8e2686c73dd006b26e50ce9a0b01eb23b Mon Sep 17 00:00:00 2001 From: L1ngg <2157878170@qq.com> Date: Mon, 2 Mar 2026 19:44:29 +0800 Subject: [PATCH 2/2] Update astrbot/core/__init__.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(core): 添加.strip()以确保代码健壮性 Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- astrbot/core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astrbot/core/__init__.py b/astrbot/core/__init__.py index 24f73071be..5c015e96e7 100644 --- a/astrbot/core/__init__.py +++ b/astrbot/core/__init__.py @@ -14,7 +14,7 @@ # 初始化数据存储文件夹 os.makedirs(get_astrbot_data_path(), exist_ok=True) -DEMO_MODE = os.getenv("DEMO_MODE", "False").lower() in ("true", "1", "t") +DEMO_MODE = os.getenv("DEMO_MODE", "False").strip().lower() in ("true", "1", "t") astrbot_config = AstrBotConfig() t2i_base_url = astrbot_config.get("t2i_endpoint", "https://t2i.soulter.top/text2img")