e2b-cookbook icon indicating copy to clipboard operation
e2b-cookbook copied to clipboard

Remove useless sandbox kill

Open Code42Cate opened this issue 3 months ago • 0 comments

Sandboxes should be removed automatically, not with explicit kill().

This breaks especially the research-agent use-case where you want to open the generated page after the agent is run, or the mcp client ones where you want to connect the gateway to claude etc.


[!NOTE] Remove explicit sandbox.kill() from MCP example scripts, keeping sandboxes alive while still closing MCP connections where used.

  • Examples:
    • Remove explicit sandbox.kill() cleanup across MCP examples to keep sandboxes available post-run:
      • examples/mcp-browserbase-js/index.ts — remove sandbox kill; close MCPServerStreamableHttp on completion.
      • examples/mcp-research-agent-js/index.ts — remove sandbox kill; close MCPServerStreamableHttp on completion.
      • examples/mcp-claude-code-js/index.ts, examples/mcp-client-js/index.ts, examples/mcp-custom-server-js/index.ts, examples/mcp-custom-template-js/index.ts, examples/mcp-groq-exa-js/index.ts — remove sandbox kill lines only.

Written by Cursor Bugbot for commit 3c6a0131bb2e0ba1110e1d6f6103d0212eb65d10. This will update automatically on new commits. Configure here.

Code42Cate avatar Oct 29 '25 12:10 Code42Cate