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.
This commit is contained in:
LIghtJUNction
2026-03-24 18:55:58 +08:00
parent 1a16a08550
commit 26c356d4d6

View File

@@ -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"