You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]:IsolationScope (SESSION/USER) does not apply to execute_shell_command working_directory #2329
When using IsolationScope.SESSION or IsolationScope.USER, the framework correctly isolates internal data (like memory files and session logs) into the specific session/user directory. However, when the Agent invokes the built-in execute_shell_command tool, the working_directory parameter does not automatically point to the isolated directory. This causes the command to fail because it attempts to execute in the project root directory instead of the isolated workspace.
Steps to Reproduce:
Configure the HarnessAgent with IsolationScope.SESSION (or USER).
Prompt the Agent to generate a Python script (e.g., generate_helloworld.py). The script is successfully created in the isolated directory (e.g., workspace/<session_id>/).
Prompt the Agent to execute the script using the execute_shell_command tool.
Observe the tool call parameters and the execution result.
Expected Behavior:
The execute_shell_command tool should automatically resolve the working_directory to the current isolated path (e.g., workspace/<session_id>/), ensuring the script can be found and executed successfully.
Actual Behavior:
The tool call parameters look like this:
{
"command": "python generate_helloworld.py",
"working_directory": "D:\\data\\spring_boot\\v420\\agent\\workspace", // Points to project root, not the session directory"timeout": 30
}
Because the file exists in the isolated directory but the command runs in the root directory, it results in a Windows system error:
Exit code: 1\n\n[stderr] The filename, directory name, or volume label syntax is incorrect.
I have submitted a fix for this issue in PR #2435.
Root Cause: resolveExecuteCwd() in LocalFilesystemWithShell short-circuits when shellCwd is set (the project root), returning it directly without applying the namespace prefix from the NamespaceFactory. This causes shell commands to run in the project root instead of the isolated session/user directory.
Fix: Use shellCwd as the base path and apply namespace resolution on top of it, so the shell working directory becomes <projectRoot>/<sessionId>/ when isolation scope is configured.
Activity
fix(agentscope-ai#2329): apply namespace scope to shellCwd in resolve…
fix: apply isolation namespace to shell execute cwd (agentscope-ai#2329…
waterWang commentedon Jul 27, 2026
I have submitted a fix for this issue in PR #2435.
Root Cause:
resolveExecuteCwd()inLocalFilesystemWithShellshort-circuits whenshellCwdis set (the project root), returning it directly without applying the namespace prefix from theNamespaceFactory. This causes shell commands to run in the project root instead of the isolated session/user directory.Fix: Use
shellCwdas the base path and apply namespace resolution on top of it, so the shell working directory becomes<projectRoot>/<sessionId>/when isolation scope is configured.oss-maintainer commentedon Jul 28, 2026
fix(harness): keep file enumeration inside the caller's namespace
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer
fix(harness): keep the workspace subtree invisible to the project layer