Make sandbox runner pluggable with Kubernetes driver support - #243
Open
eshulman2 wants to merge 3 commits into
Open
Make sandbox runner pluggable with Kubernetes driver support#243eshulman2 wants to merge 3 commits into
eshulman2 wants to merge 3 commits into
Conversation
Extract a SandboxDriver ABC from the monolithic ContainerRunner and refactor the Podman-specific logic into PodmanDriver. Add a KubernetesDriver that runs tasks as K8s Jobs with PVC-based workspace sharing. Driver selection is controlled by FORGE_SANDBOX_DRIVER (default: podman). The ContainerRunner public API is unchanged — all 15 call sites across 11 workflow nodes continue working without modification. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…itecture - Run ruff format on new sandbox source files - Update test_task_execution.py to mock ContainerRunner at the node level instead of patching removed subprocess calls - Update test_task_handoff.py to inject mock driver via constructor - Use ContainerResult dataclass instead of MagicMock to avoid attribute access issues with review_exhausted property Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Aug 6, 2026
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.
Summary
SandboxDriverABC from monolithicContainerRunner, creating a pluggable driver interface (ExecutionSpec→ExecutionResult)PodmanDriver(command building, timeout handling, image management)KubernetesDriverthat runs tasks as K8s Jobs with PVC-based workspace sharingFORGE_SANDBOX_DRIVERenv var (default:podman, also supportskubernetes)Closes #30
New files
src/forge/sandbox/driver.pySandboxDriverABC,ExecutionSpec,ExecutionResultsrc/forge/sandbox/drivers/__init__.pycreate_driver()factorysrc/forge/sandbox/drivers/podman.pyPodmanDriver(extracted from ContainerRunner)src/forge/sandbox/drivers/kubernetes.pyKubernetesDriver(K8s Job-based)tests/unit/sandbox/test_kubernetes_driver.pyConfiguration
Test plan
ruff check)FORGE_SANDBOX_DRIVER=podmanruns identically to current behavior (manual)FORGE_SANDBOX_DRIVER=kubernetesagainst a real K8s cluster🤖 Generated with Claude Code