Skip to content

Commit 7b40501

Browse files
committed
fix: improve MCP timeout and post-init error observability
1 parent a058bef commit 7b40501

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

astrbot/core/provider/func_tool_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ async def init_mcp_clients(self) -> None:
333333
if info.init_future in pending_futures:
334334
# 超时,初始化未完成,取消 task
335335
logger.error(f"MCP 服务 {info.name} 初始化超时")
336+
self._log_safe_mcp_debug_config(info.cfg)
336337
if info.task is not None:
337338
info.task.cancel()
338339
cancelled_tasks.append(info.task)
@@ -398,6 +399,7 @@ async def _init_mcp_client_task_wrapper(
398399
if not initialized:
399400
logger.error(f"初始化 MCP 客户端 {name} 失败", exc_info=True)
400401
raise
402+
logger.error(f"MCP 客户端 {name} 初始化后运行异常: {e}", exc_info=True)
401403
finally:
402404
await self._terminate_mcp_client(name)
403405

0 commit comments

Comments
 (0)