Skip to content

Commit fb39593

Browse files
authored
Merge branch 'AstrBotDevs:master' into master
2 parents ee0a85e + a93568c commit fb39593

33 files changed

Lines changed: 371 additions & 117 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ Update `astrbot`:
9292
uv tool upgrade astrbot
9393
```
9494

95+
> [!WARNING]
96+
> AstrBot deployed via `uv` **does not support upgrading through the WebUI**. To update, please run the command above from the command line.
97+
9598
### Docker Deployment
9699

97100
For users familiar with containers and looking for a more stable, production-ready deployment method, we recommend deploying AstrBot with Docker / Docker Compose.

README_fr.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ Mettre à jour `astrbot` :
9292
uv tool upgrade astrbot
9393
```
9494

95+
> [!WARNING]
96+
> AstrBot déployé via `uv` **ne prend pas en charge la mise à jour via le WebUI**. Pour mettre à jour, exécutez la commande ci-dessus depuis le terminal.
97+
9598
### Déploiement Docker
9699

97100
Pour les utilisateurs familiers avec les conteneurs et qui souhaitent une méthode plus stable et adaptée à la production, nous recommandons de déployer AstrBot avec Docker / Docker Compose.

README_ja.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ astrbot run
9292
uv tool upgrade astrbot
9393
```
9494

95+
> [!WARNING]
96+
> `uv` 経由でデプロイした AstrBot は、**WebUI からのバージョンアップグレードに対応していません**。更新するには、上記のコマンドをコマンドラインで実行してください。
97+
9598
### Docker デプロイ
9699

97100
コンテナ運用に慣れており、より安定した本番向けのデプロイ方法を求めるユーザーには、Docker / Docker Compose での AstrBot デプロイをおすすめします。

README_ru.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ astrbot run
9292
uv tool upgrade astrbot
9393
```
9494

95+
> [!WARNING]
96+
> AstrBot, развёрнутый через `uv`, **не поддерживает обновление через WebUI**. Для обновления выполните указанную выше команду из командной строки.
97+
9598
### Развёртывание Docker
9699

97100
Для пользователей, знакомых с контейнерами и которым нужен более стабильный и подходящий для production способ, мы рекомендуем разворачивать AstrBot через Docker / Docker Compose.

README_zh-TW.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ astrbot run
9292
uv tool upgrade astrbot
9393
```
9494

95+
> [!WARNING]
96+
> 透過 `uv` 部署的 AstrBot **不支援在 WebUI 中進行版本升級**。如需更新,請透過命令列執行上述命令。
97+
9598
### Docker 部署
9699

97100
對於熟悉容器、希望獲得更穩定且更適合正式環境部署方式的使用者,我們推薦使用 Docker / Docker Compose 部署 AstrBot。

README_zh.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ astrbot run
9292
uv tool upgrade astrbot
9393
```
9494

95+
> [!WARNING]
96+
> 通过 `uv` 部署的 AstrBot **不支持在 WebUI 中进行版本升级**。如需更新,请通过命令行执行上述命令。
97+
9598
### Docker 部署
9699

97100
对于熟悉容器、希望获得更稳定且更适合生产环境部署方式的用户,我们推荐使用 Docker / Docker Compose 部署 AstrBot。

astrbot/core/agent/mcp_client.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,29 @@ def _prepare_stdio_env(config: dict) -> dict:
5151
"""Preserve Windows executable resolution for stdio subprocesses."""
5252
if sys.platform != "win32":
5353
return config
54-
55-
pathext = os.environ.get("PATHEXT")
56-
if not pathext:
57-
return config
58-
5954
prepared = config.copy()
6055
env = dict(prepared.get("env") or {})
61-
env.setdefault("PATHEXT", pathext)
56+
env = _merge_environment_variables(env)
6257
prepared["env"] = env
6358
return prepared
6459

6560

61+
def _merge_environment_variables(env: dict) -> dict:
62+
"""合并环境变量,处理Windows不区分大小写的情况"""
63+
merged = env.copy()
64+
65+
# 将用户环境变量转换为统一的大小写形式便于比较
66+
user_keys_lower = {k.lower(): k for k in merged.keys()}
67+
68+
for sys_key, sys_value in os.environ.items():
69+
sys_key_lower = sys_key.lower()
70+
if sys_key_lower not in user_keys_lower:
71+
# 使用系统环境变量中的原始大小写
72+
merged[sys_key] = sys_value
73+
74+
return merged
75+
76+
6677
async def _quick_test_mcp_connection(config: dict) -> tuple[bool, str]:
6778
"""Quick test MCP server connectivity"""
6879
import aiohttp

astrbot/core/config/default.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,18 @@ class ChatProviderTemplate(TypedDict):
12521252
"proxy": "",
12531253
"custom_headers": {},
12541254
},
1255+
"LongCat": {
1256+
"id": "longcat",
1257+
"provider": "longcat",
1258+
"type": "longcat_chat_completion",
1259+
"provider_type": "chat_completion",
1260+
"enable": True,
1261+
"key": [],
1262+
"api_base": "https://api.longcat.chat/openai",
1263+
"timeout": 120,
1264+
"proxy": "",
1265+
"custom_headers": {},
1266+
},
12551267
"AIHubMix": {
12561268
"id": "aihubmix",
12571269
"provider": "aihubmix",
@@ -1770,6 +1782,7 @@ class ChatProviderTemplate(TypedDict):
17701782
"enable": True,
17711783
"rerank_api_key": "",
17721784
"rerank_api_base": "http://127.0.0.1:8000",
1785+
"rerank_api_suffix": "/v1/rerank",
17731786
"rerank_model": "BAAI/bge-reranker-base",
17741787
"timeout": 20,
17751788
},
@@ -1835,7 +1848,12 @@ class ChatProviderTemplate(TypedDict):
18351848
"rerank_api_base": {
18361849
"description": "重排序模型 API Base URL",
18371850
"type": "string",
1838-
"hint": "AstrBot 会在请求时在末尾加上 /v1/rerank。",
1851+
"hint": "最终请求路径由 Base URL 和路径后缀拼接而成(默认为 /v1/rerank)。",
1852+
},
1853+
"rerank_api_suffix": {
1854+
"description": "API URL 路径后缀",
1855+
"type": "string",
1856+
"hint": "追加到 base_url 后的路径,如 /v1/rerank。留空则不追加。",
18391857
},
18401858
"rerank_api_key": {
18411859
"description": "API Key",

astrbot/core/pipeline/waking_check/stage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"qq_official_webhook": lambda e: e.get_sender_id(),
2323
"lark": lambda e: f"{e.get_sender_id()}%{e.get_group_id()}",
2424
"misskey": lambda e: f"{e.get_session_id()}_{e.get_sender_id()}",
25+
"matrix": lambda e: f"{e.get_sender_id()}_{e.get_group_id() or e.get_session_id()}",
2526
}
2627

2728

astrbot/core/platform/sources/discord/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ def __init__(self, token: str, proxy: str | None = None) -> None:
3535
async def on_ready(self) -> None:
3636
"""当机器人成功连接并准备就绪时触发"""
3737
if self.user is None:
38-
logger.error("[Discord] 客户端未正确加载用户信息 (self.user is None)")
38+
logger.error("[Discord] Bot user not loaded correctly (self.user is None)")
3939
return
4040

41-
logger.info(f"[Discord] 已作为 {self.user} (ID: {self.user.id}) 登录")
42-
logger.info("[Discord] 客户端已准备就绪。")
41+
logger.info(f"[Discord] Logged in as {self.user} (ID: {self.user.id})")
42+
logger.info("[Discord] Client is ready.")
4343

4444
if self.on_ready_once_callback and not self._ready_once_fired:
4545
self._ready_once_fired = True
4646
try:
4747
await self.on_ready_once_callback()
4848
except Exception as e:
4949
logger.error(
50-
f"[Discord] on_ready_once_callback 执行失败: {e}",
50+
f"[Discord] Failed to execute on_ready_once_callback: {e}",
5151
exc_info=True,
5252
)
5353

@@ -99,7 +99,7 @@ async def on_message(self, message: discord.Message) -> None:
9999
return
100100

101101
logger.debug(
102-
f"[Discord] 收到原始消息 from {message.author.name}: {message.content}",
102+
f"[Discord] Received raw message from {message.author.name}: {message.content}",
103103
)
104104

105105
if self.on_message_received:

0 commit comments

Comments
 (0)