diff --git a/.gitignore b/.gitignore index 81fd7fc4..be2b5ab3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ node_modules/ # Worktrees .worktrees/ + +# Accidental literal "~" directories (e.g. when a configured path contains "~" but isn't expanded) +backend/~/ diff --git a/backend/app/services/agent_provisioning.py b/backend/app/services/agent_provisioning.py index a1214d3d..c3640f9e 100644 --- a/backend/app/services/agent_provisioning.py +++ b/backend/app/services/agent_provisioning.py @@ -130,7 +130,9 @@ def _ensure_workspace_file( ) -> None: if not workspace_path or not name: return - root = Path(workspace_path) + # `gateway.workspace_root` is sometimes configured as `~/.openclaw`. + # Expand user here to avoid creating a literal `./~` directory under the backend cwd. + root = Path(workspace_path).expanduser() path = root / name if not overwrite and path.exists(): return