Skip to content

Apply cwd to bash kernel contexts#269

Merged
mishushakov merged 2 commits into
mainfrom
mishushakov/bash-kernel-pwd-cwd
May 14, 2026
Merged

Apply cwd to bash kernel contexts#269
mishushakov merged 2 commits into
mainfrom
mishushakov/bash-kernel-pwd-cwd

Conversation

@mishushakov
Copy link
Copy Markdown
Member

Summary

  • change_current_directory in template/server/messaging.py handled python, javascript/typescript, r, and java but fell through to a no-op for bash, so a context created with a non-default cwd still returned / from pwd.
  • Added a bash branch that sends cd <path> to the kernel, plus bash cwd tests across sync/async Python and JS suites (the gap that let this regression slip in).
  • Changeset: patch bump for @e2b/code-interpreter-template.

Refs: e2b-dev/E2B#1318

🤖 Generated with Claude Code

The change_current_directory handler in the template server only had
branches for python, javascript/typescript, r, and java — bash fell
through to the no-op else, so a context created with a non-default cwd
still returned `/` from `pwd`. Added a bash branch that sends `cd <path>`
and added bash cwd tests across sync/async python and js suites.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented May 14, 2026

PR Summary

Low Risk
Small, isolated change to the bash cwd setup plus added tests; low risk aside from potential quoting/escaping edge cases in cd commands.

Overview
Bash kernels were not applying the requested cwd, so commands like pwd could still report /; change_current_directory now issues a cd for language == "bash".

Adds bash cwd assertions to the JS and Python (sync/async) test suites and includes a patch changeset for @e2b/code-interpreter-template.

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

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: 8f692797f4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread template/server/messaging.py Outdated
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 1 potential issue.

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 8f69279. Configure here.

Comment thread template/server/messaging.py Outdated
Matches the quoting used in the js, r, and java branches so paths
containing spaces or shell metacharacters cd to the intended directory.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Comment thread template/server/messaging.py Outdated
@mishushakov mishushakov enabled auto-merge (squash) May 14, 2026 18:13
@mishushakov mishushakov merged commit 5fedbea into main May 14, 2026
26 of 28 checks passed
@mishushakov mishushakov deleted the mishushakov/bash-kernel-pwd-cwd branch May 14, 2026 18:19
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