agentscope-ai / agentscope-ai/agentscope-java

SandboxClientOptions.workspaceRoot vs WorkspaceSpec.root — duplicate configuration

Ouverte
#2,171 5 commentaires 0 réactions 1 personne assignée Réclamée par @chcodex Voir sur GitHub
area/core enhancement
Langage dominant
Java
Étoiles
5.6k
Forks
1.3k
Merge moyen
4 j 12 h
PR mergées (30 j)
77

Description

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?

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.