SandboxClientOptions.workspaceRoot vs WorkspaceSpec.root — duplicate configuration
When configuring a sandbox filesystem, users need to set the workspace root path in two separate places, which is confusing and error-prone:
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:
SandboxClientOptions.workspaceRoot— read by*SandboxClient.create()to set the sandbox state's internal rootWorkspaceSpec.root— read byAbstractBaseSandbox(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:
- Are these two values intentionally redundant, or is this a legacy design that should be consolidated?
- If we keep only
WorkspaceSpec.rootas the single source of truth, could*SandboxClient.create()readworkspaceSpec.getRoot()instead ofoptions.getWorkspaceRoot()? - Would a PR to remove
SandboxClientOptions.workspaceRootand redirect everything throughWorkspaceSpec.rootbe accepted?
@chickenlj @jujn Can you help me answer this question?
@chickenlj @jujn Can you help me answer this question?
At present, I am not particularly familiar with the harness module, so I cannot provide a clear answer to you. You can wait for now, or follow other issues. We warmly welcome your contribution.
@chickenlj This code was committed by you. Could you help clarify this issue?
From the documentation, these two seem to have the same meaning.
@Chickenlj @LearningGp @fang-tech @flystar32 @albumenj @guanxuc @JGoP-L @shiyiyue1102 @jujn @KomachiSion
Is there anyone who can help answer this question?