From a3f944450fd01d11ee5c7e0d816a50b59c2d11c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Fri, 20 Mar 2026 19:01:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=BB=8E=20os.envir?= =?UTF-8?q?on=20=E8=AF=BB=E5=8F=96=E7=A9=BA=E5=80=BC=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/bot_manager.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/routes/bot_manager.py b/routes/bot_manager.py index 43e2e2f..fe2c26c 100644 --- a/routes/bot_manager.py +++ b/routes/bot_manager.py @@ -1842,6 +1842,13 @@ async def get_bot_settings(bot_uuid: str, authorization: Optional[str] = Header( # 清理不在 skill 所需变量中且值为空的环境变量 shell_env = {k: v for k, v in shell_env.items() if v or k in required_keys} + # 对于值为空的环境变量,尝试从系统环境变量中读取 + for k, v in shell_env.items(): + if not v: + env_val = os.environ.get(k, '') + if env_val: + shell_env[k] = env_val + return BotSettingsResponse( bot_id=str(bot_id), name=bot_name,