Repository navigation
Description
Is your feature request related to a problem? Please describe.
E2B offers persistent volumes that exist independently of sandbox lifecycles and can be mounted to sandboxes at custom paths (volumeMounts: [{name, path}] on POST /sandboxes). The current agentscope-extensions-sandbox-e2b module has no way to pass volume mounts: E2bPlatformHttp.createSandbox() only sends templateID + timeout, and there is no mount option on E2bSandboxClientOptions / E2bFilesystemSpec. So users who need cross-sandbox persistence on E2B must fall back to TAR persist/hydrate on every turn. (There is only an empty placeholder, mounts/E2bCloudBucketMountStrategy.)
Describe the solution you'd like
Support mounting pre-existing E2B volumes at sandbox creation time:
- New
E2bVolumeMountPOJO (name= existing volume name,path= absolute in-sandbox mount path, with validation + normalization). E2bSandboxClientOptions.volumeMounts(+ builder/fluent adders) and matchingE2bFilesystemSpec.volumeMount(name, path)/volumeMounts(...)— same pattern asAgentRunFilesystemSpec.nasConfig/addOssMount, noharness-corechanges.E2bPlatformHttp.createSandbox()serializesvolumeMounts: [{name, path}]intoPOST /sandboxes(omit the field when empty); surface 400s (no beta access / unknown volume name) with the response body.- Thread mounts through
E2bSandboxClient.create()intoE2bSandboxState.volumeMounts, and pass them on every creation path inE2bSandbox(ensureSandbox()new + connect-fallback recreate,restoreSandboxFromSnapshotTemplate()). - Allow
workspaceRootto live on a volume mount (E2bSandboxState.workspaceOnVolume, computed asroot.equals(mount) || root.startsWith(mount + "/"), mirroringAgentRunSandboxClientworkspaceOnNasdetection): when true,doPersistWorkspace()/doHydrateWorkspace()become no-ops anddoDestroyWorkspace()skipsrm -rf. When a mount point sits underworkspaceRootwithout covering it, exclude it from the TAR archive (same--excludeapproach asWorkspaceMountSupport.tarExcludeArgsForBindMounts). - Update
E2bSandboxClient.copy()/merge()for the new field, keepE2bSandboxStateJSON backward compatible, remove or implement theE2bCloudBucketMountStrategyplaceholder. - Tests:
POST /sandboxesbody assertion with mounts (MockWebServer), validation/normalization/workspaceOnVolumeunit tests, options merge + serde round-trip, recovery with mounts. - Docs: E2B section of
docs/v2/en/docs/harness/filesystem.mdplus a volume example.
References: E2B POST /sandboxes volumeMounts (SandboxVolumeMount{name, path}), https://docs.e2b.dev/volumes/mount, https://docs.e2b.dev/volumes.
Describe alternatives you've considered
- New
WorkspaceSpecentry subtype (e.g.VolumeMountEntry): more uniform across backends but requiresharness-coreWorkspaceEntry+ Jackson changes; rejected in favor of the provider-options pattern already used by AgentRun NAS/OSS mounts. - Also wrapping Volume lifecycle APIs (
POST/DELETE /volumes, Volume Content API read/write): out of scope for now; creation/management stays in E2B dashboard/SDK, this issue covers attach-at-create only.
Additional context
- E2B Volumes are in private beta; behavior without access is a 400 from the platform, which should propagate clearly.
- Open question for implementation: whether
NATIVE_SNAPSHOTcaptures volume content — doc will recommend TAR + volume (or no-op persist) for theworkspaceOnVolumecase until verified.
Activity
oss-maintainer commentedon Sep 15, 2026
Issue Evaluation
Category:
enhancement| Status: Evaluated — feasible, provider-local, recommend proceedingVerified against
main(97696a3a). Every factual claim in the report checks out, and the upstream API shape matches what is proposed.Codebase claims — confirmed
E2bPlatformHttp.java:54-57—createSandbox(templateId, timeoutSeconds)puts onlytemplateID+timeout; there is no mount parameter anywhere in the module.E2bSandboxClientOptions.java:25-42— no volume/mount field;E2bFilesystemSpec.java:33-103— no corresponding fluent setter.mounts/E2bCloudBucketMountStrategy.javais a genuinely empty placeholder (// intentionally empty — extend when wiring E2B volume mounts…), so item 6's "remove or implement" is a real cleanup, not new work.E2bSandboxState.java:23-31— no volume fields, confirming the persistence gap.createSandbox:E2bSandbox.java:173-177(ensureSandbox()new),:191-196(connect-failure recreate),:207-209(restoreSandboxFromSnapshotTemplate()). Any mount plumbing has to reach all three or recovery silently loses the volume — the report is right to call this out explicitly.doDestroyWorkspace()runsrm -rf <workspaceRoot>unconditionally (E2bSandbox.java:154-163), anddoPersistWorkspace()TARs the root (:88-110). A volume-backedworkspaceRootwould be both archived redundantly and deleted on destroy.AgentRunSandboxClient.java:85+isWorkspaceUnderMounts(:146-162) setworkspaceOnNas, andAgentRunSandbox.doPersistWorkspace()returnsInputStream.nullInputStream()in that case (:133-137). Mirroring this for E2B is consistent with an established pattern in the repo rather than a new convention.Upstream API — confirmed
E2B's public OpenAPI for
POST /sandboxesdefinesNewSandbox.volumeMountsas an array ofSandboxVolumeMount{ name, path }with both fields required — i.e. the array-of-objects body shape proposed in item 3, not the path-keyed map used by the JS/Python SDKs. Since this module speaks the platform REST API directly (apiBaseUrl = https://api.e2b.app), the report picked the correct spelling. Volume endpoints (/volumeslist/create/get/delete) are also in the public API, and E2B publishes a "Volumes beta limitations" FAQ, which supports the private-beta caveat.Three refinements worth settling before implementation
isWorkspaceUnderMountsuses a bareroot.startsWith(mountDir), so/mnt/data-xwould wrongly match a/mnt/datamount. The proposedroot.equals(mount) || root.startsWith(mount + "/")is strictly correct — implement it as written, and consider it a bug worth back-filling in AgentRun separately rather than copying the weaker predicate. AgentRun also skips read-only mounts when deciding (!m.isReadOnly()); a read-only E2B volume must not qualify as a workspace host either.NATIVE_SNAPSHOTneeds a definite answer, not a doc hedge. Because mounts are re-attached onrestoreSandboxFromSnapshotTemplate()(item 4), volume content survives a snapshot restore by construction — but if the snapshot also captures volume content, restore-time duplication is the risk. Item 7's MockWebServer coverage cannot answer this; it needs one real-beta run. Suggested: land attach-at-create +workspaceOnVolumeno-op first, and leave aTODO(volume-snapshot)inE2bPersistenceMode.NATIVE_SNAPSHOTjavadoc until verified.E2bSandboxStateis Jackson-registered viaE2bHarnessSandboxJacksonModule;volumeMountsmust default to empty andworkspaceOnVolumetofalsewhen absent so already-persisted sessions still deserialize — that is the exact class of failure reported in [Bug]: Failed to deserialize Docker sandbox state #1584 for Docker sandbox state.Tradeoff on the rejected alternative. The
WorkspaceSpecentry-subtype option is correctly rejected for now:WorkspaceMountSupport.tarExcludeArgsForBindMounts(agentscope-harness/.../WorkspaceMountSupport.java:66-78) already generates TAR--excludeargs fromBindMountEntry, and E2B already feeds it atE2bSandbox.java:102. A genericWorkspaceSpecvolume entry would let every backend reuse that exclusion path — so if a second provider needs this, revisit option B rather than duplicating per-provider exclusion logic. Provider options keep the change out ofagentscope-coretoday; the harness abstraction is the right call later.Scope / effort: medium — one module (
agentscope-extensions-sandbox-e2b), 7 files + tests + docs, noharness-corechange, no breaking API. Compatibility: additive; old serialized state must remain readable.The proposal as written is implementable and well-scoped. Maintainer input welcome on point 2 (beta access) before a PR is opened; if the shape is agreed, reply
/approveand a fix proposal will be generated against items 1-6 with the tests described in item 7.Automated evaluation by github-manager-bot
oss-maintainer commentedon Sep 18, 2026
Status: 72 h feedback window expired — no automated PR will be generated, this proposal window here is closed
The evaluation above went 72 hours (since 2026-09-15T10:13:53Z) without a
/approve,/revise, or/rejectreply, so per our workflow no competing PR will be filed from this proposal window and the window is closed. No action is needed from anyone.As of this check there is no open PR linked to this issue, so nothing is being retired here on account of a competing fix — the proposal simply timed out.
The evaluation itself is unchanged and stays on the record as the starting point if this is picked up later: E2B volume-mount support is feasible and provider-local (
agentscope-extensions-sandbox-e2b, ~7 files, additive API, noagentscope-corechange), theNewSandbox.volumeMountsarray-of-{name,path}shape matches E2B's public OpenAPI rather than the path-keyed map used by the JS/Python SDKs, and the three refinements named in the evaluation — theroot.equals(mount) || root.startsWith(mount + "/")mount matcher (stronger thanAgentRunSandboxClient.isWorkspaceUnderMounts' barestartsWith), a definiteNATIVE_SNAPSHOTanswer backed by one real-beta run, and defaultingvolumeMounts/workspaceOnVolumeinE2bSandboxStateso already-persisted sessions still deserialize — are the parts worth carrying into any implementation.Point 2 of that evaluation (private-beta access needed to verify snapshot/volume interaction) is the reason this window was flagged for maintainer input rather than implemented directly. If a maintainer still wants an independent proposal here, reply on this issue and we will re-evaluate; a community PR claiming this work needs no coordination from us first.
Automated feedback-window poll by github-manager-bot (HEARTBEAT §3, issue-to-pr Step 6). Posted 2026-09-18T10:25Z.
fix(e2b): address review feedback on volume mounts
feat(e2b): support mounting pre-existing volumes at sandbox creation
test(e2b): add live tests for E2B volume mounts
fix(e2b): address review feedback on volume mounts
feat(e2b): support mounting pre-existing volumes at sandbox creation
test(e2b): add live tests for E2B volume mounts
fix(e2b): address review feedback on volume mounts
fix(e2b): address review feedback on volume mounts
feat(e2b): support mounting pre-existing volumes at sandbox creation
test(e2b): add live tests for E2B volume mounts
fix(e2b): address review feedback on volume mounts
feat(e2b): support mounting pre-existing volumes at sandbox creation
test(e2b): add live tests for E2B volume mounts
fix(e2b): address review feedback on volume mounts
feat(e2b): support mounting pre-existing volumes at sandbox creation
test(e2b): add live tests for E2B volume mounts
fix(e2b): address review feedback on volume mounts
feat(e2b): support mounting pre-existing volumes at sandbox creation
test(e2b): add live tests for E2B volume mounts
fix(e2b): address review feedback on volume mounts
feat(e2b): support mounting pre-existing volumes at sandbox creation (#…