Repository navigation
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @DZH166 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' |
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
TASTE.md review — checked parity (T-1, T-1a, T-2), API shape/signatures (T-3, T-3a), returned types (T-16), shell/string correctness (T-43) and docstring style (T-69, T-71) against the changed code.
1 violation found:
- T-1 (cross-language parity): the decoding fix is Python-only; JS
parseGitStatuskeeps returning git-quoted paths, sosandbox.git.status()now reports differentname/renamed_fromvalues in JS and Python for the same repo. Details inline onparse.py. The PR description acknowledges this as a follow-up, but T-1 calls parity non-negotiable, so the JS change should ship together.
Everything else in the diff complies: no public signatures change, the helpers are private and shared by the sync and async Python surfaces (T-2), and the new docstrings use reST :param: / :return: fields (T-71).
Not a TASTE rule, but worth noting: AGENTS.md asks for a changeset when a public method's behavior changes, and this PR changes the strings Sandbox.git.status() returns. No .changeset/ entry is included.
| renamed = _split_rename(path) | ||
| if renamed is None: | ||
| name = _unquote_path(path) | ||
| else: | ||
| renamed_from, name = (_unquote_path(part) for part in renamed) |
There was a problem hiding this comment.
T-1 — JS, sync Python and async Python mirror each other 1:1 in names and semantics.
After this change sandbox.git.status() returns different name / renamed_from strings for the same repository depending on the SDK: Python yields café.txt / sp ace dir/, while JS parseGitStatus (packages/js-sdk/src/sandbox/git/utils.ts) still yields "caf\303\251.txt" / "sp ace dir/" and still splits a quoted "a -> b.txt" on the inner separator. Code ported between SDKs will silently behave differently, and the JS bug stays live.
Sync and async Python are fine here since both go through the shared e2b/sandbox/_git/parse.py (T-2). The compliant form is to land the same decoding in JS in this PR rather than as a follow-up, e.g.:
const renamed = splitRename(path)
const name = unquotePath(renamed ? renamed[1] : path)
const renamedFrom = renamed ? unquotePath(renamed[0]) : undefinedwith an unquotePath that handles the same \", \\, \a…\v and octal \nnn escapes (decoding the bytes as UTF-8), and matching tests in packages/js-sdk/tests. The same applies to the untracked branch on line 241.
There was a problem hiding this comment.
Devin Review found 1 potential issue.
3 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| if line.startswith("?? "): | ||
| name = line[3:] | ||
| name = _unquote_path(line[3:]) | ||
| file_status.append( |
There was a problem hiding this comment.
🟡 Git status paths differ across SDKs
For quoted filenames, Python git.status() returns literal paths, but JavaScript parseGitStatus still returns Git’s escaped text. JavaScript callers cannot reuse those strings as file paths.
Learn more
The repository requires equivalent changes across the SDKs in the SDK parity rule. Both synchronous status and asynchronous status use the Python parser. JavaScript status still calls a parser that keeps Git's display text for untracked paths and does not decode rename paths.
Example: For a new café.txt, Python returns café.txt, but JavaScript returns the quoted text "caf\303\251.txt". That text names a different file when passed to the filesystem API.
Recommended fix: Apply the equivalent decoding and rename parsing to JavaScript in this PR, and test the public status result with the same quoted filename and rename cases.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 579d170144
ℹ️ 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".
| if renamed is None: | ||
| name = _unquote_path(path) | ||
| else: | ||
| renamed_from, name = (_unquote_path(part) for part in renamed) |
There was a problem hiding this comment.
Mirror quoted-path decoding in the JavaScript SDK
For repositories containing Unicode filenames or quoted renames, this creates a cross-SDK behavior mismatch: Python now returns filesystem paths, while packages/js-sdk/src/sandbox/git/utils.ts:414-440 still returns quoted text and splits rename separators inside quoted names. Root AGENTS.md requires “equivalent changes” in both JS and sync/async Python implementations. Both Python APIs share this parser, but the JS implementation needs equivalent decoding and regression coverage rather than being deferred to a follow-up.
AGENTS.md reference: AGENTS.md:L3-L3
Useful? React with 👍 / 👎.
| for line in lines[1:]: | ||
| if line.startswith("?? "): | ||
| name = line[3:] | ||
| name = _unquote_path(line[3:]) |
There was a problem hiding this comment.
Add a changeset for the public status-output change
This changes the public GitFileStatus.name and renamed_from values returned by Sandbox.git.status(), but neither the commit’s two-file diff nor the existing .changeset/ entries contains a release note for this fix. Root AGENTS.md requires a changeset “when changing the public surface” of the Python SDK. Add a changeset describing the decoded-path behavior so the fix has its own versioning and changelog record instead of relying on unrelated pending release entries.
AGENTS.md reference: AGENTS.md:L7-L7
Useful? React with 👍 / 👎.
| ], | ||
| ) | ||
| def test_should_decode_a_quoted_untracked_path(self, line, expected): | ||
| status = parse_git_status(f"## main\n{line}\n") |
There was a problem hiding this comment.
Exercise quoting regressions through the public status API
The parameterized quoting cases call the private _git.parse helper directly rather than the public status API. Root AGENTS.md requires following skills/tdd/SKILL.md, which explicitly says tests “live at seams, never against internals.” A private parser move or replacement would therefore break these tests even if SDK behavior remained unchanged. Run these fixtures through the same Git(StubCommands(...)).status(...) boundary already used by the final test, preserving the assertions without coupling them to the parser’s internal location.
AGENTS.md reference: AGENTS.md:L6-L6
Useful? React with 👍 / 👎.
Problem
Sandbox.git.status()reports git-quoted paths instead of the paths on disk. Porcelain v1 output quotes any path that is not plain printable ASCII — non-ASCII names, tabs and newlines, quotes, and every untracked directory (quoted because of its trailing/), with non-ASCII bytes written as octal escapes under the defaultcore.quotePath.For a repository with an untracked
sp ace dir/, acafé.txtand a rename intorenamed plain.txt:The names carry the quote characters and the undecoded octal escapes, so they cannot be passed back to
files.read(),files.list()or a shell command — the entries are effectively unusable for any repository with an untracked directory or a non-ASCII filename.Fix
parse_git_statusnow decodes porcelain path quoting:_unquote_path()handles the quote and control-character escapes (\",\\,\a,\b,\f,\n,\r,\t,\v) and the octal\nnnbyte escapes, reassembling the bytes and decoding them as UTF-8. Unquoted paths pass through unchanged._split_rename()finds the->separator only after the closing quote of a quoted source path, so a name that itself contains->is split correctly; both sides are decoded.No signature, default or request behavior changes — only the reported
name/renamed_fromstrings, and only for entries git had quoted:The JS SDK's
parseGitStatus(packages/js-sdk/src/sandbox/git/utils.ts) still returns the quoted text; the equivalent parser change there is a follow-up so this PR stays a Python-only fix.Tests
packages/python-sdk/tests/test_git_status_quoting.py(new, offline):->;Git.status()end to end with a stub command runner replaying recorded porcelain output.Fixtures come from real
git status --porcelain=1 -boutput. Existing suites:13 passed, 31 skippedwithtests/shared/git(gated behindENABLE_GIT_TESTS),513 passedfor the whole offline top-level suite.