From c234801be6720ea25859b8b39618eadacbd8324e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sun, 19 Jul 2026 16:28:38 -0400 Subject: [PATCH] fix(cli): reject normalized agent directory names --- elydora/_runtime_paths.py | 1 + tests/test_runtime_paths.py | 1 + 2 files changed, 2 insertions(+) diff --git a/elydora/_runtime_paths.py b/elydora/_runtime_paths.py index 3fe0bfa..03a2acf 100644 --- a/elydora/_runtime_paths.py +++ b/elydora/_runtime_paths.py @@ -22,6 +22,7 @@ def resolve_agent_directory(root: str, agent_id: str) -> str: or "/" in agent_id or "\\" in agent_id or agent_id in {".", ".."} + or agent_id.startswith(" ") or agent_id.endswith((".", " ")) or _WINDOWS_DEVICE_NAME.match(agent_id) ): diff --git a/tests/test_runtime_paths.py b/tests/test_runtime_paths.py index 449523c..d70cafe 100644 --- a/tests/test_runtime_paths.py +++ b/tests/test_runtime_paths.py @@ -22,6 +22,7 @@ from elydora import cli "C:escape", "agent.", "agent ", + " agent", "CON", "COM¹.log", ".",