Skip to content

fix(sdk): report both-added and both-deleted Git conflicts - #2153

Closed
Elon-Jiang wants to merge 1 commit into
e2b-dev:mainfrom
Elon-Jiang:fix/git-unmerged-status
Closed

Elon-Jiang wants to merge 1 commit into
e2b-dev:mainfrom
Elon-Jiang:fix/git-unmerged-status

Conversation

@Elon-Jiang

@Elon-Jiang Elon-Jiang commented Nov 17, 2026 •

Copy link
Copy Markdown

Problem and fix

Both SDKs recognize a Git path as conflicted only when its porcelain status contains U. Git also uses AA (both added) and DD (both deleted) for unresolved merges. Those paths currently appear as ordinary additions/deletions, and hasConflicts / has_conflicts and the conflict count omit them.

Recognize the two additional unmerged pairs in the JS parser and the shared Python parser (used by both sync and async APIs). Ordinary changes retain their classifications. Includes a patch changeset for both SDKs.

The Git status contract lists all seven unmerged pairs. This fixes existing behavior in the currently exported, deprecated Git helper; it adds no new API.

Usage example

After a merge with one add/add conflict:

const status = await sandbox.git.status(repoPath)
// fileStatus[0].status === 'conflict'
// hasConflicts === true, conflictCount === 1
status = sandbox.git.status(repo_path)
# or: status = await async_sandbox.git.status(repo_path)
# file_status[0].status == "conflict"
# has_conflicts is True, conflict_count == 1

Verification

  • JS public Sandbox.git.status() regression matrix: 2 failing / 10 controls passing before, 12 passing after. Runs the real Connect JSON encoding/decoding, Commands, command handles and Git status parsing with an envd transport response fixture.
  • Separate local JS public-interface reproduction: real Git index stages emit all seven porcelain codes; AA/DD fail before, all 7 pass after. Native-process test code stays outside the committed JS suite so that suite uses only runtime-portable Web APIs.
  • Python sync + async public Sandbox.git.status() / AsyncSandbox.git.status(): 4 failing / 20 controls passing before, 24 passing after. AA comes from real add/add merges and DD from real rename/rename merges in temporary repositories. The other unmerged codes are rendered by real Git from native index stages. The real RPC clients/codecs and command handling consume this output through a supplied transport. Native Git fixtures are Unix-only.
  • Related JS suites: 135 passing, 32 skipped (the existing Git-test opt-in gate).
  • Related Python suites: 39 passing, 6 skipped, followed by an explicit run of the six pure Git argument/parity tests with their opt-in flag: 6 passing. No cloud-dependent suite was enabled.
  • Required root pnpm run format, pnpm run lint, pnpm run typecheck pass, including SDK builds. Four pre-existing lint warnings remain in unchanged files. Final Python Ruff and ty checks pass after strengthening the real-merge fixtures. git diff --check passes.

No live E2B sandbox or guest process was used: local Git produces the status output, while envd/network execution is replaced at the transport boundary. Undici's native network path and live sandbox behavior were not measured. The existing documented status contract already covers conflict flags/counts; no separate guide change is needed.

Prepared with AI assistance.


Devin Review

@changeset-bot

changeset-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 24ce758

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

This PR includes changesets to release 3 packages
Name Type
e2b Patch
@e2b/python-sdk Patch
@e2b/code-interpreter-python Patch

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T04:36:24.042855Z 24ce758 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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TASTE.md review: no violations found — the AA/DD conflict fix is mirrored identically in JS and the shared Python parser used by sync and async (T-1, T-2), adds no new public surface (T-3–T-25 n/a), and ships with a patch changeset.

Written by Devin

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@mishushakov

Copy link
Copy Markdown
Member

Hey, the Git integration has been deprecated for a while now:
https://docs.e2b.dev/migration/git-deprecation

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