From f05ac55875360cf7fd4cce146d609afc6ef2ea1a Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Wed, 27 May 2026 15:27:44 +0200 Subject: [PATCH] fix: expand ~ in git mount target paths to avoid /tmp --- apps/api/src/api/tool_instances.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/api/src/api/tool_instances.py b/apps/api/src/api/tool_instances.py index 5ba9a36..5ba0134 100644 --- a/apps/api/src/api/tool_instances.py +++ b/apps/api/src/api/tool_instances.py @@ -110,6 +110,13 @@ async def _resolve_single_git_mount( logger.warning("Invalid git mount skipped: missing remote_url or target_path") return [] + # Expand ~ to the working directory or a default home path + # (The container may have HOME set to /tmp, so we resolve it ourselves) + if target_path.startswith("~"): + home = working_directory or "/home/user" + target_path = home + target_path[1:] + logger.info("Expanded ~ to %s", target_path) + # Resolve relative target paths against working directory if target_path and not target_path.startswith("/"): base = working_directory or "/home/user"