From 1bc639715cd194fc80b975d1e36ccef4366c8fcc Mon Sep 17 00:00:00 2001 From: danielmeppiel Date: Sun, 22 Mar 2026 17:52:45 +0100 Subject: [PATCH] fix: resolve both sides of relative_to() for Windows 8.3 path compat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows CI runners, Path.resolve() expands 8.3 short names (RUNNER~1 → runneradmin). If only base_dir is resolved but agents_path is not, relative_to() raises ValueError and falls back to absolute paths. Fix: call .resolve() on both sides of relative_to() in _generate_placement_summary and _generate_distributed_summary. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/apm_cli/compilation/agents_compiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apm_cli/compilation/agents_compiler.py b/src/apm_cli/compilation/agents_compiler.py index 17fb2a27..0df0ec41 100644 --- a/src/apm_cli/compilation/agents_compiler.py +++ b/src/apm_cli/compilation/agents_compiler.py @@ -838,7 +838,7 @@ def _generate_placement_summary(self, distributed_result) -> str: for placement in distributed_result.placements: try: - rel_path = placement.agents_path.relative_to(self.base_dir.resolve()).as_posix() + rel_path = placement.agents_path.resolve().relative_to(self.base_dir.resolve()).as_posix() except ValueError: rel_path = str(placement.agents_path) lines.append(f"{rel_path}") @@ -868,7 +868,7 @@ def _generate_distributed_summary(self, distributed_result, config: CompilationC for placement in distributed_result.placements: try: - rel_path = placement.agents_path.relative_to(self.base_dir.resolve()).as_posix() + rel_path = placement.agents_path.resolve().relative_to(self.base_dir.resolve()).as_posix() except ValueError: rel_path = str(placement.agents_path) lines.append(f"- {rel_path} ({len(placement.instructions)} instructions)")