fix: expand ~ for workspace files and ignore backend tilde dir

This commit is contained in:
Abhimanyu Saharan
2026-02-07 03:42:10 +05:30
parent e71507e0bf
commit decf1f8dc4
2 changed files with 6 additions and 1 deletions

View File

@@ -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