Skip to content

SandboxClientOptions.workspaceRoot vs WorkspaceSpec.root — duplicate configuration #2171

Open

Description

@chcodex

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:

  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?

Activity

  1. added
    enhancement
    area/core
    on Jul 13, 2026
  2. chcodex commented on Jul 13, 2026

    @chcodex
    ContributorAuthor

    @chickenlj @jujn Can you help me answer this question?

  3. jujn commented on Jul 13, 2026

    @jujn
    Collaborator

    @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.

  4. chcodex commented on Jul 13, 2026

    @chcodex
    ContributorAuthor

    @chickenlj This code was committed by you. Could you help clarify this issue?

  5. chcodex commented on Jul 14, 2026

    @chcodex
    ContributorAuthor
    Image Image From the documentation, these two seem to have the same meaning.
  6. chcodex commented on Jul 14, 2026

    @chcodex
    ContributorAuthor
  7. moved this from Backlog to In progress in AgentScope Javaon Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/coreenhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions