From 43efef442c2bdfec8c5b6fbb6b0973f0557d509e Mon Sep 17 00:00:00 2001 From: Weilong Liao <37870767+Soulter@users.noreply.github.com> Date: Mon, 8 Jun 2026 01:19:54 +0800 Subject: [PATCH] Update astrbot/core/tools/message_tools.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- astrbot/core/tools/message_tools.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/astrbot/core/tools/message_tools.py b/astrbot/core/tools/message_tools.py index 8106fed2c..4763907e1 100644 --- a/astrbot/core/tools/message_tools.py +++ b/astrbot/core/tools/message_tools.py @@ -27,12 +27,15 @@ from astrbot.core.utils.astrbot_path import ( ) -def _file_send_allowed_roots(umo: str) -> tuple[Path, ...]: - return ( - workspace_root(umo), +def _file_send_allowed_roots(umo: str | None) -> tuple[Path, ...]: + roots = [] + if umo: + roots.append(workspace_root(umo)) + roots.extend([ Path(get_astrbot_temp_path()).resolve(strict=False), Path(get_astrbot_system_tmp_path()).resolve(strict=False), - ) + ]) + return tuple(roots) def _is_path_within(path: Path, roots: tuple[Path, ...]) -> bool: