Skip to content

The agent that grows with you

fix(projects): write host_workspace only for the session's own folder

kshitijk4poore864515d2651
diff --git a/tools/terminal_tool.py b/tools/terminal_tool.py
index 9b48c19312a..86aea6f3625 100644
--- a/tools/terminal_tool.py
+++ b/tools/terminal_tool.py
@@ -336,6 +336,10 @@ def register_task_env_overrides(task_id: str, overrides: dict[str, Any]):
(host workspaces are tracked there on purpose); only the live-env write is
sanitized, since a host cwd can never be a container workdir.
+ ``host_workspace`` is host-side only: a Desktop session's own folder when its ``cwd`` is left
+ empty because an unmounted Docker sandbox cannot see it (project tools read it; the terminal
+ never does).
+
Keyed like ``_session_cwd`` — routed-profile qualified (:func:`_qualify_task_key`) — so two
profiles registering the same task id never read each other's image/cwd (#123989).
"""
diff --git a/tui_gateway/session_workdir.py b/tui_gateway/session_workdir.py
index 55f3ca38f73..247805f60ea 100644
--- a/tui_gateway/session_workdir.py
+++ b/tui_gateway/session_workdir.py
@@ -539,8 +539,9 @@ def _register_session_cwd(session: dict | None) -> None:
# A host cwd is not a directory in this sandbox. An empty cwd leaves its configured cwd
# and a later in-container cd intact; host-side readers (project tools) still find the
# session's own folder under ``host_workspace``.
- host = cwd if cwd_source == "session" else ""
- overrides = {"cwd": "", "cwd_source": "process", "host_workspace": host}
+ overrides = {"cwd": "", "cwd_source": "process"}
+ if cwd_source == "session":
+ overrides["host_workspace"] = cwd
register_task_env_overrides(session["session_key"], overrides)