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 摘要。