Skip to content

Disconnect from fire-and-forget background commands#211

Open
mishushakov wants to merge 3 commits into
mainfrom
mishushakov/disconnect-after-run
Open

Disconnect from fire-and-forget background commands#211
mishushakov wants to merge 3 commits into
mainfrom
mishushakov/disconnect-after-run

Conversation

@mishushakov
Copy link
Copy Markdown
Member

Adds a .disconnect() call after every fire-and-forget background commands.run in both the JS and Python SDKs — the cases where the command's output stream is never consumed (xdg-open, gtk-launch, Xvfb, and startxfce4). Per the e2b SDK, disconnect() keeps the process running but stops the SDK from holding the event stream open, avoiding a leaked streaming connection for each backgrounded process. Calls whose output is read and the noVNC handle (stored and killed later) are left untouched.

🤖 Generated with Claude Code

Call .disconnect() after background commands.run calls whose output is
never read, so the SDK stops holding the event stream open while the
process keeps running.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mishushakov mishushakov requested a review from mlejva as a code owner June 6, 2026 11:50
@cla-bot cla-bot Bot added the cla-signed label Jun 6, 2026
@cursor
Copy link
Copy Markdown

cursor Bot commented Jun 6, 2026

PR Summary

Low Risk
Narrow connection-lifecycle change on long-running desktop helpers; no auth, data, or API contract changes.

Overview
Both @e2b/desktop and @e2b/desktop-python now call .disconnect() on the handle returned from background commands.run when output is never read: open (xdg-open), launch (gtk-launch), sandbox startup (Xvfb), and startxfce4. That closes the SDK event stream without stopping the process. Background runs that still need the handle (e.g. noVNC, kept for kill on stop) are unchanged. Patch changesets were added for both packages.

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

mishushakov and others added 2 commits June 6, 2026 13:51
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant