Add Piston sandbox plugin#46
Open
eric-tramel wants to merge 2 commits into
Open
Conversation
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.
What
Adds
data-designer-sandbox-piston, a self-contained Data Designer plugin that registers thecode-sandboxcolumn type. The column executes source code from an existing dataset column through a configured local or remote Piston API and returns structured execution metadata including stdout, stderr, output, exit code, status, timing, and memory fields.The package also includes a stdio MCP server exposing a
run_codetool, helper config for creating Data Designer MCP providers/tool config, documentation, and Docker-based local/remote deployment examples.Why
This makes the Big Iron sandbox/code-execution pattern available in the public plugin repo without Big Iron-specific deployment assumptions. Users can point Data Designer at a Piston endpoint running locally on macOS/Linux or at a separately managed remote service.
Usage
Column execution:
MCP helper:
Local Piston helper:
How
The implementation uses a shared
aiohttpPiston client, structuredSandboxOutputparsing, an adaptive concurrency controller with bounded retry/backpressure behavior, and a synchronous Data Designer column generator wrapper that preserves DataFrame row ordering. The MCP server launches as a stdio process and reads runtime settings from environment variables supplied bySandboxMCPConfigor the caller's environment.The local Docker helper now mounts
/pistonto a Docker volume so stock Piston has a writable package store. Runtime defaults align with stock Piston's3000ms run limit, andpython_packagesis treated as declarative metadata for prebuilt custom Python runtimes rather than an implicit runtime-build request.This PR intentionally leaves
catalog/plugins.jsonunchanged; this repo's scaffold/release validation treats catalog registration as a first-release step.Validation
data-designer config listconfirmed thegpt-5.5model alias.plugins/data-designer-sandbox-piston/scripts/run-local-piston.shand installedpython3.12.0with Piston's package API.55with exit code0.gpt-5.5to generate Python code, thencode-sandboxexecuted it in Piston and returned stdout650with exit code0.gpt-5.5withtool_alias="sandbox"; the trace shows onerun_codecall and returned stdout6469693118with exit code0.make formatmake plugin-docsmake test-plugin PLUGIN=data-designer-sandbox-pistonmake validatemake checkmake lintmake test-devtoolsmake test-pluginsmake docs