From 26c356d4d6014d3b9a4efb66deacdc1750551e3c Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Tue, 24 Mar 2026 18:55:58 +0800 Subject: [PATCH] fix(cli): move runtime bootstrap into run command Previously initialize_runtime_bootstrap() was called at module level, causing it to run for ALL astrbot CLI commands (conf admin, etc). Now it only runs when the 'run' command is executed. --- astrbot/cli/commands/cmd_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astrbot/cli/commands/cmd_run.py b/astrbot/cli/commands/cmd_run.py index f0180396b..51dba6a0a 100644 --- a/astrbot/cli/commands/cmd_run.py +++ b/astrbot/cli/commands/cmd_run.py @@ -61,7 +61,6 @@ from astrbot.runtime_bootstrap import initialize_runtime_bootstrap if not (sys.version_info.major == 3 and sys.version_info.minor in (12, 13)): sys.exit(1) -initialize_runtime_bootstrap() # Regular expression to find bash-like parameter expansions: # ${VAR:-default} or ${VAR} _PARAM_EXPAND_RE = re.compile(r"\$\{([^}:]+?)(:-([^}]*))?\}") @@ -169,6 +168,7 @@ def run( debug: bool, ) -> None: """Run AstrBot""" + initialize_runtime_bootstrap() try: if debug: log_level = "DEBUG"