From 03475102e2c632fde85d180f65c8a40bcf85eb1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Sun, 29 Dec 2024 11:14:49 +0100 Subject: [PATCH] fix: create workspace symlink in log folder, load on resume (#368) --- gptme/chat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gptme/chat.py b/gptme/chat.py index e98206ea..5f3ff408 100644 --- a/gptme/chat.py +++ b/gptme/chat.py @@ -73,15 +73,17 @@ def chat( # change to workspace directory # use if exists, create if @log, or use given path + # TODO: move this into LogManager? then just os.chdir(manager.workspace) log_workspace = logdir / "workspace" if log_workspace.exists(): assert not workspace or ( workspace == log_workspace ), f"Workspace already exists in {log_workspace}, wont override." - workspace = log_workspace + workspace = log_workspace.resolve() else: if not workspace: workspace = Path.cwd() + log_workspace.symlink_to(workspace, target_is_directory=True) assert workspace.exists(), f"Workspace path {workspace} does not exist" console.log(f"Using workspace at {path_with_tilde(workspace)}") os.chdir(workspace)