fix(sandbox): serialize E2B release transitions#4355
Merged
WillemJiang merged 1 commit intoJul 22, 2026
Conversation
March-77
marked this pull request as ready for review
July 22, 2026 02:02
WillemJiang
approved these changes
Jul 22, 2026
yogyoho
added a commit
to yogyoho/eai-flow-main
that referenced
this pull request
Jul 23, 2026
…UI hardening - bytedance#4117 XSS hardening (isSafeHref, iframe sandbox, safeLocalStorage) - bytedance#4354 streaming chunk batcher for large file tools - bytedance#4294 LLM concurrency cap + burst-rate retry shedding - bytedance#4355 E2B release serialization - bytedance#4267 transient image context cleanup - bytedance#4374 AI disclaimer (bytedance#4373 reasoning-effort default) - bytedance#4337 /goal length validation + counter - bytedance#4278/bytedance#4302/bytedance#4312 URL encoding fixes - bytedance#4375 list_uploaded_files schema fix - bytedance#4288 uploads markdown companion name claim - bytedance#4258 remove frontend debug logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
acquire()and the fullrelease()state transition with the existing per-user/thread lockbackend/AGENTS.mdWhy
release()removed the active mappings before syncing outputs and publishing the warm-pool entry. A concurrent acquire for the same thread could observe neither state and reconnect or create a sandbox while release was still operating on the previous client.Impact
Within one Gateway process, a same-thread acquire now waits for release to finish, then reclaims the warm sandbox. Multi-process coordination remains outside this issue's stated scope.
Validation
pytest tests/test_e2b_sandbox_provider.py -q— 64 passedruff checkon the changed Python files — passedruff format --checkon the changed Python files — passedCloses #4333