Skip to content

fix(sandbox): prevent E2B sync marker race - #339

Open
ShiroKSH wants to merge 1 commit into
frankbria:mainfrom
ShiroKSH:fix/e2b-sync-marker-race
Open

fix(sandbox): prevent E2B sync marker race#339
ShiroKSH wants to merge 1 commit into
frankbria:mainfrom
ShiroKSH:fix/e2b-sync-marker-race

Conversation

@ShiroKSH

Copy link
Copy Markdown

Summary

  • snapshot the E2B download watermark before scanning the remote workspace
  • promote that pending watermark only after the host acknowledges extraction
  • cover writes that land between download and acknowledgement

Root cause

The download scanned files against the previous marker, while acknowledgement advanced the marker to the later acknowledgement time. A remote write that landed after the scan but before acknowledgement could therefore be older than the new marker without ever being included in an archive.

The pending marker records the scan boundary up front. Acknowledgement atomically promotes that boundary, preserving at-least-once delivery and keeping repeated acknowledgements idempotent.

Validation

  • four E2B acknowledgement-focused Bats tests pass
  • regression test reproduces a write between download and acknowledgement and verifies the next download includes it
  • Python syntax compilation passes
  • Bats parses all 94 tests in the E2B unit file
  • git diff validation passes

@ShiroKSH
ShiroKSH marked this pull request as ready for review July 11, 2026 14:19
@ShiroKSH

Copy link
Copy Markdown
Author

@frankbria We'd appreciate it if you could take a look at this pull request when you have a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant