Skip to content

refactor(sandbox): extract Runner interface and move Docker runner to pkg/sandbox#1639

Open
tdabasinskas wants to merge 1 commit intodocker:mainfrom
cogvel:upstream/sandbox-runner-interface
Open

refactor(sandbox): extract Runner interface and move Docker runner to pkg/sandbox#1639
tdabasinskas wants to merge 1 commit intodocker:mainfrom
cogvel:upstream/sandbox-runner-interface

Conversation

@tdabasinskas
Copy link
Contributor

Introduce a pluggable sandbox.Runner interface to decouple shell tool execution from the Docker sandbox implementation. This enables adding alternative sandbox backends without modifying the shell tool itself.

Changes:

  • Add sandbox.Runner interface in pkg/sandbox/runner.go
  • Move and refactor Docker sandbox from pkg/tools/builtin/sandbox.go to pkg/sandbox/docker.go, implementing the Runner interface
  • Update ShellTool to accept sandbox.Runner instead of the concrete *sandboxRunner type
  • Update registry to create sandbox.DockerRunner and pass it to ShellTool

@dgageot, FYI (I see you added the initial support for Sandbox under #1209).

… pkg/sandbox

Introduce a pluggable sandbox.Runner interface to decouple shell tool
execution from the Docker sandbox implementation. This enables adding
alternative sandbox backends without modifying the shell tool itself.

Changes:
- Add sandbox.Runner interface in pkg/sandbox/runner.go
- Move and refactor Docker sandbox from pkg/tools/builtin/sandbox.go
  to pkg/sandbox/docker.go, implementing the Runner interface
- Update ShellTool to accept sandbox.Runner instead of the concrete
  *sandboxRunner type
- Update registry to create sandbox.DockerRunner and pass it to
  ShellTool

Signed-off-by: Tomas Dabašinskas <tomas.dabasinskas@cogvel.com>
@tdabasinskas tdabasinskas marked this pull request as ready for review February 8, 2026 13:27
@tdabasinskas tdabasinskas requested a review from a team as a code owner February 8, 2026 13:27
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