agentscope-ai / agentscope-ai/agentscope-java

SandboxClientOptions.workspaceRoot vs WorkspaceSpec.root — duplicate configuration

Aperta
#2,171 5 commenti 0 reazioni 1 assegnatario Rivendicata da @chcodex Vedi su GitHub
area/core enhancement
Lingua principale
Java
Stelle
5.6k
Fork
1.3k
Merge medio
4g 12h
PR unite (30g)
77

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.