Skip to content

feat(sdk): add allowNetworkMounts option to filesystem watch#1420

Merged
mishushakov merged 4 commits into
mainfrom
mishushakov/sdk-support-infra-2982
Jun 15, 2026
Merged

feat(sdk): add allowNetworkMounts option to filesystem watch#1420
mishushakov merged 4 commits into
mainfrom
mishushakov/sdk-support-infra-2982

Conversation

@mishushakov

Copy link
Copy Markdown
Member

Client-side counterpart to e2b-dev/infra#2982: adds an allowNetworkMounts/allow_network_mounts option to filesystem directory watching across the JS and Python (sync + async) SDKs, so clients can explicitly opt into watching paths on network filesystem mounts (NFS, CIFS, SMB, FUSE), which envd rejects by default. Events on network mounts may be unreliable or not delivered at all, hence the explicit opt-in.

This regenerates the filesystem proto code from the updated spec and threads the flag through watchDir/watch_dir (streaming WatchDir and polling CreateWatcher). The option requires envd 0.6.4 (shipped by the infra PR); using it against an older sandbox throws a TemplateError/TemplateException. Default behavior is unchanged.

Includes new watch tests for all three SDKs and a minor-bump changeset for e2b and @e2b/python-sdk.

Note: the new tests exercise the flag on a regular directory (a network mount can't be set up from SDK tests) and require envd 0.6.4, so this should land with/after the infra deploy. All pre-existing watch tests pass; the new ones currently fail with the expected TemplateError against the deployed envd.

Usage

JavaScript

const handle = await sandbox.files.watchDir(
  '/mnt/nfs-share/my-dir',
  (event) => console.log(event.type, event.name),
  { allowNetworkMounts: true }
)

Python (async)

handle = await sandbox.files.watch_dir(
    "/mnt/nfs-share/my-dir",
    on_event=lambda e: print(e.type, e.name),
    allow_network_mounts=True,
)

Python (sync)

handle = sandbox.files.watch_dir("/mnt/nfs-share/my-dir", allow_network_mounts=True)
for e in handle.get_new_events():
    print(e.type, e.name)

🤖 Generated with Claude Code

Client-side counterpart to e2b-dev/infra#2982: adds an
allowNetworkMounts/allow_network_mounts option to filesystem directory
watching across the JS and Python (sync + async) SDKs, allowing watching
paths on network filesystem mounts (NFS, CIFS, SMB, FUSE), which are
rejected by default. Requires envd 0.6.4 or later; watching with the
option against an older sandbox raises a template error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jun 11, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Opt-in watch flag with unchanged defaults and version checks; main risk is shipping before envd 0.6.4 is available in templates.

Overview
Adds allow_network_mounts to WatchDirRequest and CreateWatcherRequest in the filesystem proto and regenerated JS/Python bindings, plus allowNetworkMounts / allow_network_mounts on watch APIs with envd 0.6.4 gating via TemplateError / TemplateException.

New watch tests only cover the flag on a normal directory, not a real network mount (expected for SDK tests). They also depend on envd 0.6.4; against older sandboxes the new tests fail until the matching infra change is deployed. There is no test that the client rejects allow_network_mounts when envd is below 0.6.4.

Reviewed by Cursor Bugbot for commit a715c56. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Package Artifacts

Built from 58bddf1. Download artifacts from this workflow run.

JS SDK (e2b@2.29.2-mishushakov-sdk-support-infra-2982.0):

npm install ./e2b-2.29.2-mishushakov-sdk-support-infra-2982.0.tgz

CLI (@e2b/cli@2.11.2-mishushakov-sdk-support-infra-2982.0):

npm install ./e2b-cli-2.11.2-mishushakov-sdk-support-infra-2982.0.tgz

Python SDK (e2b==2.28.2+mishushakov-sdk-support-infra-2982):

pip install ./e2b-2.28.2+mishushakov.sdk.support.infra.2982-py3-none-any.whl

@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a715c56

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@e2b/python-sdk Minor
e2b Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mishushakov mishushakov requested a review from huv1k June 15, 2026 12:20
@mishushakov mishushakov merged commit e873ee9 into main Jun 15, 2026
36 of 37 checks passed
@mishushakov mishushakov deleted the mishushakov/sdk-support-infra-2982 branch June 15, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants