agentscope-ai / agentscope-ai/agentscope-java

SandboxClientOptions.workspaceRoot vs WorkspaceSpec.root — duplicate configuration

Aberta
#2,171 5 comentários 0 reações 1 responsável Reivindicada por @chcodex Ver no GitHub
area/core enhancement
Linguagem predominante
Java
Estrelas
5.6k
Forks
1.3k
Merge médio
4d 12h
PRs com merge (30d)
77

Descrição

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?

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.