agentscope-ai / agentscope-ai/agentscope-java

[Bug]:IsolationScope (SESSION/USER) does not apply to execute_shell_command working_directory

Ouverte
#2,329 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area/build area/core/memory area/core/tool area/harness bug
Langage dominant
Java
Étoiles
5.6k
Forks
1.3k
Merge moyen
4 j 12 h
PR mergées (30 j)
77

Description

# Description:
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//).
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//), ensuring the script can be found and executed successfully.
## Actual Behavior:
The tool call parameters look like this:
```json
{
"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.
## Environment:
AgentScope Java Version: 2.0.0

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.