Skip to content

fix(template): quote Bash context working directories - #353

Open
Apeksha9389 wants to merge 1 commit into
e2b-dev:mainfrom
Apeksha9389:fix/quote-bash-context-cwd
Open

Apeksha9389 wants to merge 1 commit into
e2b-dev:mainfrom
Apeksha9389:fix/quote-bash-context-cwd

Conversation

@Apeksha9389

Copy link
Copy Markdown

A Bash context whose existing working-directory path contains a single quote is created with the wrong actual directory. For example, a directory named it's working produces an invalid cd '.../it's working' command. The context can still report the requested cwd even though pwd remains in the original directory, so later relative file operations target the wrong location.

Use shlex.quote() for the Bash path instead of surrounding it with literal single quotes. Includes a template patch changeset.

Validation on Python 3.12: 8 selected HTTP-level context tests pass against a local template server backed by real Jupyter Python and Bash kernels. The apostrophe regression fails on unchanged main by observing the wrong pwd; the space-only control passes there. Added tests create and remove actual directories and contexts through the existing harness. Ruff 0.11.13 check/format pass on the changed files.

The cloud sandbox suite and other language kernels were not run. This changes only Bash cwd handling.

Prepared with AI assistance; reproduced and tested locally.

@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-20T19:00:38.169516Z 60ec431 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.

@mishushakov
mishushakov enabled auto-merge (squash) October 21, 2026 13:03
@mishushakov
mishushakov disabled auto-merge October 21, 2026 13:03
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