From b89b5a7e2c339278f493883ecc36a5fd7f3b1266 Mon Sep 17 00:00:00 2001 From: Re-bin Date: Sat, 28 Feb 2026 08:09:56 +0000 Subject: [PATCH] refactor: compress _extract_absolute_paths comments --- nanobot/agent/tools/shell.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/nanobot/agent/tools/shell.py b/nanobot/agent/tools/shell.py index 71cbd00..6b57874 100644 --- a/nanobot/agent/tools/shell.py +++ b/nanobot/agent/tools/shell.py @@ -153,10 +153,6 @@ class ExecTool(Tool): @staticmethod def _extract_absolute_paths(command: str) -> list[str]: - # Match Windows absolute paths without truncating at backslashes. - win_paths = re.findall(r"[A-Za-z]:\\[^\s\"'|><;]+", command) - # Only match absolute paths — avoid false positives on relative - # paths like ".venv/bin/python" where "/bin/python" would be - # incorrectly extracted by the old pattern. - posix_paths = re.findall(r"(?:^|[\s|>])(/[^\s\"'>]+)", command) + win_paths = re.findall(r"[A-Za-z]:\\[^\s\"'|><;]+", command) # Windows: C:\... + posix_paths = re.findall(r"(?:^|[\s|>])(/[^\s\"'>]+)", command) # POSIX: /absolute only return win_paths + posix_paths