Skip to content

Conversation

@djeebus
Copy link
Contributor

@djeebus djeebus commented Oct 10, 2025

This gives us a place to put sandbox-specific code, to execute on insert, on delete, etc


Note

Adds a sandbox-specific map with insert/remove hooks and execution-aware deletion, refactoring orchestrator components to use it.

  • Core:
    • New sandbox.Map: Strongly-typed wrapper around smap with Subscribe, Insert, Remove, RemoveByExecutionID, Items, Get, Count, and NewSandboxesMap() in internal/sandbox/map.go.
    • Cleanup path now uses RemoveByExecutionID to avoid removing resumed sandboxes.
  • API changes (type replacements):
    • *smap.Map[*sandbox.Sandbox]*sandbox.Map across constructors and fields:
      • proxy.NewSandboxProxy, hyperloopserver.NewHyperloopServer/handlers.NewHyperloopStore.
      • metrics.NewSandboxObserver.
      • Server/service: internal/server structs and ServiceConfig.
      • Template build: build.Builder, layer.NewLayerExecutor, template server server.New.
      • Binaries/tests: main.go, cmd/build-template, benchmark_test.go, and sandboxes_test.go.
  • Callsite updates:
    • Use sandbox.NewSandboxesMap() to construct.
    • Replace sandboxes.Insert(id, sbx) with sandboxes.Insert(sbx).
    • Update removal logic and proxy usages accordingly.

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

this allows us to put sandbox-specific code here, to
execute on insert, on delete, etc
@djeebus djeebus added the improvement Improvement for current functionality label Oct 10, 2025
@e2b-request-same-site-reviewers e2b-request-same-site-reviewers bot requested review from ValentaTomas and removed request for ValentaTomas, dobrac and jakubno October 10, 2025 16:03
cursor[bot]

This comment was marked as outdated.

@djeebus
Copy link
Contributor Author

djeebus commented Oct 10, 2025

This prepares the codebase for #1333

@ValentaTomas ValentaTomas self-assigned this Oct 10, 2025
@djeebus djeebus merged commit c6600ba into main Oct 10, 2025
45 of 46 checks passed
@djeebus djeebus deleted the sandboxes-container branch October 10, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement for current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants