Skip to content

Use official connectRPC library for python env#1314

Open
matthewlouisbrockman wants to merge 19 commits intomainfrom
python/connect-rpc-migration
Open

Use official connectRPC library for python env#1314
matthewlouisbrockman wants to merge 19 commits intomainfrom
python/connect-rpc-migration

Conversation

@matthewlouisbrockman
Copy link
Copy Markdown
Contributor

@matthewlouisbrockman matthewlouisbrockman commented May 6, 2026

migrates python envd RPC generation to the official Connect RPC python plugin (js already uses the equivalent)

keeps packages/connect-python for now to avoid the codeql complaint, can remove that later as standalone.

main thing here: we got more tests in, but it doesn't have support for the proxy behavior we have so we needed to write a httpx wrapper instead of pyqwest so it may just defeat the purpose of using the real library.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

🦋 Changeset detected

Latest commit: 9d667ba

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

This PR includes changesets to release 1 package
Name Type
@e2b/python-sdk 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

@cursor
Copy link
Copy Markdown

cursor Bot commented May 6, 2026

PR Summary

High Risk
Replaces the SDK’s RPC transport/client stack (including streaming and timeouts) and bumps core deps (protobuf/new connectrpc), which can easily break runtime behavior across sync/async sandboxes.

Overview
Switches Python envd RPC generation and runtime from the in-repo e2b_connect implementation to the official connectrpc plugin/library, replacing generated *_connect.py clients and updating all sandbox filesystem/process call sites accordingly.

This drops e2b_connect entirely, adds connectrpc/pyqwest deps (and bumps protobuf), and introduces a custom httpx adapter plus new timeout/header handling to preserve existing proxy/streaming behavior; error mapping logic is also adjusted (including a fallback mapping UNKNOWN ENOENT messages to FileNotFoundException).

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Package Artifacts

Built from bac46a3. Download artifacts from this workflow run.

JS SDK (e2b@2.19.6-python-connect-rpc-migration.0):

npm install ./e2b-2.19.6-python-connect-rpc-migration.0.tgz

CLI (@e2b/cli@2.10.2-python-connect-rpc-migration.0):

npm install ./e2b-cli-2.10.2-python-connect-rpc-migration.0.tgz

Python SDK (e2b==2.21.0+python-connect-rpc-migration):

pip install ./e2b-2.21.0+python.connect.rpc.migration-py3-none-any.whl

Comment thread packages/python-sdk/e2b/sandbox_async/commands/command.py Outdated
Comment thread packages/python-sdk/e2b/envd/rpc.py
Comment thread packages/python-sdk/e2b/sandbox_async/main.py Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a60552436

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/python-sdk/e2b/sandbox_sync/commands/command.py Outdated
Comment thread packages/python-sdk/e2b/sandbox_sync/main.py Outdated
Comment thread packages/python-sdk/e2b/sandbox_async/commands/command.py Outdated
Comment thread packages/python-sdk/e2b/sandbox_async/main.py Outdated
Comment thread packages/python-sdk/e2b/sandbox_async/filesystem/filesystem.py
@matthewlouisbrockman matthewlouisbrockman force-pushed the python/connect-rpc-migration branch from 8522c9e to 47facc0 Compare May 6, 2026 23:39
Comment thread packages/python-sdk/e2b/envd/rpc.py Outdated
Comment thread packages/python-sdk/e2b/envd/rpc.py Outdated
Comment thread packages/python-sdk/e2b/envd/pyqwest_httpx_adapter.py
Comment thread packages/python-sdk/e2b/envd/rpc.py Outdated
Comment thread packages/python-sdk/e2b/envd/rpc.py
@matthewlouisbrockman
Copy link
Copy Markdown
Contributor Author

alright, the bots are picking up on a ton of things that are clearly not in the test coverage... so i guess it's really want to fix the test coverage

Comment thread packages/python-sdk/e2b/envd/pyqwest_httpx_adapter.py
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0a551a1. Configure here.

Comment thread packages/python-sdk/e2b/envd/pyqwest_httpx_adapter.py Outdated
Comment thread packages/python-sdk/e2b/envd/rpc.py
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