Skip to content

fix(template): recreate deleted default language contexts - #352

Open
Apeksha9389 wants to merge 1 commit into
e2b-dev:mainfrom
Apeksha9389:fix/recreate-deleted-default-context
Open

Apeksha9389 wants to merge 1 commit into
e2b-dev:mainfrom
Apeksha9389:fix/recreate-deleted-default-context

Conversation

@Apeksha9389

Copy link
Copy Markdown

Deleting a default language context removes its live connection but leaves its id in default_websockets. The next run_code(..., language="python") resolves that stale id and returns HTTP 404 instead of creating a replacement. Executions without a language also need the same default-resolution path.

Route implicit Python execution through the existing per-language lock and recreate a default when its cached id is absent from the live context registry. Refresh the Python default alias when creating its replacement. Explicit context ids retain their existing lookup and 404 behavior. Includes a template patch changeset.

Validation on Python 3.12:

  • The explicit-language deletion regression fails on unchanged main with 404 Not Found: Context None not found.
  • Ten selected HTTP-level context tests pass against a local Python-only template server backed by a real Jupyter kernel over a Unix socket. They cover both deletion forms, default and non-default restart, context independence, invalid arguments and unknown ids. The explicit-language regression also passes on a fresh local server.
  • Ruff 0.11.13 check and format pass on both changed Python files.

No cloud sandbox, other language kernels, or full integration-suite run was performed. The added tests use the existing CodeInterpreter harness and standard client fixture, so they also run in the repository's sandbox test setup.

Prepared with AI assistance; reproduced and tested locally.

@cla-bot

cla-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @Apeksha9389 on file. You can sign our CLA at https://e2b.dev/docs/cla . Once you've signed, post a comment here that says '@cla-bot check'

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T11:43:51.868665Z cf5471f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Apeksha9389

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Oct 20, 2026
@cla-bot

cla-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

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