Repository navigation
fix(e2b): honor WorkspaceSpec root and rebind remote snapshots - #4081
Merged
jujn merged 2 commits intoNov 11, 2026
Merged
Conversation
Resolve the effective workspace root from WorkspaceSpec when present, persist it on create, and synchronize it on resume so exec cwd and volume coverage use the configured root. Override the two-argument deserializeState to rebind RemoteSnapshotClient into a deserialized RemoteSandboxSnapshot, matching Docker and Kubernetes.
chcodex
added a commit
to chcodex/agentscope-java
that referenced
this pull request
Nov 9, 2026
…ebind remote snapshots
jujn
approved these changes
Nov 11, 2026
chickenlj
pushed a commit
that referenced
this pull request
Nov 13, 2026
Backport the verified fix to the 2.0.x implementation and retain its existing public contracts where the upstream kernel differs. (cherry picked from commit c887528) Backport-review-patch: 59c40e0e42acfb64f103e5e1aa27f8fcfa0c3aa6 Constraint: No AgentScope Service or SDK migration Confidence: high Not-tested: Whole-repository verification pending after lane integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4080
Summary
This fixes two E2B sandbox defects on
main:E2bSandboxClientignoredWorkspaceSpec.root, soE2bSandbox.doExecran with the options default root (/home/user) instead of the configured workspace root.resume()also kept the stale persisted root, and volume coverage was computed from the wrong root.E2bSandboxClientdid not override the two-argumentdeserializeState, so a deserializedRemoteSandboxSnapshotkeptclient == nulland failed withRemoteSnapshotClient is not bound to snapshot id: ....Changes
E2bSandboxClient.javaWorkspaceSpec.rootwhen non-blank, falling back to the merged options/state root.create().resume()and recomputeworkspaceOnVolumefrom it.isWorkspaceOnVolumeto take the effective root plus mounts.deserializeState(String, SandboxSnapshotSpec)to rebindRemoteSnapshotClientinto aRemoteSandboxSnapshot, preserving the snapshot id (same pattern as Docker and Kubernetes).E2bSandboxWorkspaceRootTestcovering create, resume, and volume detection.E2bSandboxClientRemoteSnapshotTestcovering remote snapshot client rebinding.E2bVolumeMountTestfixtures to match the new authoritative-spec-root semantics.Verification
mvn -pl agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b \ test \ -Dtest=E2bSandboxWorkspaceRootTest,E2bSandboxClientRemoteSnapshotTest,E2bVolumeMountTest,E2bSandboxOptionsAndStateTest,E2bSandboxRecoveryTest,E2bSandboxEnvsTest,E2bEnvdSandboxUrlTest \ -DfailIfNoTests=false -Dcheckstyle.skip=true -Dspotless.check.skip=trueResult:
Tests run: 67, Failures: 0, Errors: 0, Skipped: 0.mvn -pl agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b spotless:checkpasses.Note: a full module test run also executes
E2bVolumeMountLiveTest, which requiresE2B_VOLUME_NAME; those 5 errors are pre-existing live-test environment gating and unrelated to this change.Risk / compatibility
WorkspaceSpec.rootbecomes authoritative when set. Callers that previously relied onE2bSandboxClientOptions.workspaceRootwinning over a non-blank spec root will now use the spec root. This matches the documentedWorkspaceSpeccontract and the intended runtime behavior.RemoteSnapshotSpec; local/noop snapshot behavior is unchanged.Merge order