From 795bdef587fc365d2a566105c30469999210919e Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 20 May 2026 02:53:55 +0100 Subject: Change to cwd only when it exists in the tool call container. --- kaagum/tools.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kaagum/tools.scm b/kaagum/tools.scm index 97f0796..65060ea 100644 --- a/kaagum/tools.scm +++ b/kaagum/tools.scm @@ -267,7 +267,11 @@ available tools to their respective @code{} objects." args)) (tool-container-namespaces tool) (lambda () - (chdir (tool-call-session-cwd tool-call)) + ;; If the tool does not mount the current directory in the + ;; container, it may not exist. So, chdir only when the + ;; current directory exists in the container. + (when (file-exists? (tool-call-session-cwd tool-call)) + (chdir (tool-call-session-cwd tool-call))) (apply (tool-proc tool) args))))) ;; Build result. -- cgit 1.4.1