agentscope-ai / agentscope-ai/agentscope-java

SandboxClientOptions.workspaceRoot vs WorkspaceSpec.root — duplicate configuration

未关闭
#2,171 5 条评论 0 个 reaction 已指派 1 人 已被 @chcodex 认领 在 GitHub 查看
area/core enhancement
主要语言
Java
星标
5.6k
派生
1.3k
平均合并
4 天 12 小时
30 天内合并 PR
77

描述

When configuring a sandbox filesystem, users need to set the workspace root path in two separate places, which is confusing and error-prone:

```java
WorkspaceSpec workspaceSpec = new WorkspaceSpec();
workspaceSpec.setRoot("/home/user/workspace");

SandboxFilesystemSpec filesystemSpec = new E2bFilesystemSpec()
.workspaceRoot("/home/user/workspace") // → SandboxClientOptions.workspaceRoot
.workspaceSpec(workspaceSpec) // → WorkspaceSpec.root
...
```

There are two independent configuration paths for the same concept:

1. **`SandboxClientOptions.workspaceRoot`** — read by `*SandboxClient.create()` to set the sandbox state's internal root
2. **`WorkspaceSpec.root`** — read by `AbstractBaseSandbox` (`WorkspaceSpecApplier`) for spec apply / mount calculations

If a user sets only one and not the other, the sandbox may behave inconsistently (e.g., exec commands use one path while mount/bind logic uses another).

Questions:
1. Are these two values intentionally redundant, or is this a legacy design that should be consolidated?
2. If we keep only `WorkspaceSpec.root` as the single source of truth, could `*SandboxClient.create()` read `workspaceSpec.getRoot()` instead of `options.getWorkspaceRoot()`?
3. Would a PR to remove `SandboxClientOptions.workspaceRoot` and redirect everything through `WorkspaceSpec.root` be accepted?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。