Skip to content

fix(core): call createAsync() for E2B sandbox initialization in Agent.create/resume#31

Merged
CrazyBoyM merged 1 commit intoshareAI-lab:mainfrom
Gui-Yue:e2b_fix
Feb 2, 2026
Merged

fix(core): call createAsync() for E2B sandbox initialization in Agent.create/resume#31
CrazyBoyM merged 1 commit intoshareAI-lab:mainfrom
Gui-Yue:e2b_fix

Conversation

@Gui-Yue
Copy link
Contributor

@Gui-Yue Gui-Yue commented Jan 30, 2026

概述

修复 E2B 沙箱在 Agent.create()Agent.resume() 中未初始化的问题

问题描述

使用 E2B 沙箱时,Agent.create()Agent.resume() 调用的是同步方法 SandboxFactory.create(),导致 E2B 沙箱的 init() 方法从未被调用,沙箱处于未初始化状态。

修复方案

将两处 sandboxFactory.create() 改为 await sandboxFactory.createAsync()

  • agent.ts:358 (Agent.create)
  • agent.ts:750 (Agent.resume)

createAsync() 会检测 E2B 沙箱并调用其 init() 方法完成初始化。

测试验证

  • 228 个单元测试全部通过
  • 对 Local 沙箱无影响(无需 init)

@CrazyBoyM CrazyBoyM merged commit a31b71b into shareAI-lab:main Feb 2, 2026
8 checks passed
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.

2 participants