Skip to content

Conversation

@ValentaTomas
Copy link
Member

@ValentaTomas ValentaTomas commented Dec 21, 2025

Note

Adds APIs to connect to existing PTY sessions in JS and Python SDKs, with tests and default connection timeout handling.

  • SDKs:
    • JS (packages/js-sdk/src/sandbox/commands/pty.ts):
      • Add Pty.connect(pid, opts?) to attach to a running PTY; introduce PtyConnectOpts.
      • Use defaultPtyConnectionTimeout as fallback for timeoutMs in create/connect.
    • Python Async (e2b/sandbox_async/commands/pty.py):
      • Add Pty.connect(pid, on_data, timeout?, request_timeout?) returning AsyncCommandHandle.
    • Python Sync (e2b/sandbox_sync/commands/pty.py):
      • Add Pty.connect(pid, timeout?, request_timeout?) returning CommandHandle.
  • Tests:
    • JS: packages/js-sdk/tests/sandbox/pty/ptyConnect.test.ts validates connect/reconnect and output handling.
    • Python: Async tests/async/sandbox_async/pty/test_pty_connect.py and Sync tests/sync/sandbox_sync/pty/test_pty_connect.py verify reconnect behavior and exit codes.
  • Changeset: Minor bumps for @e2b/python-sdk and e2b with note on connecting to running PTY sessions.

Written by Cursor Bugbot for commit 0e3f245. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link

changeset-bot bot commented Dec 21, 2025

🦋 Changeset detected

Latest commit: 0e3f245

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 enabled auto-merge (squash) December 22, 2025 17:10
@mishushakov mishushakov merged commit 2d5af16 into main Dec 22, 2025
11 checks passed
@mishushakov mishushakov deleted the pty-reconnect branch December 22, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants