Repository navigation
Closed
Labels
Milestone
Description
Part of #1020
The problem
Today's code_interpreter() / local_code_interpreter() helpers are function-shaped and tightly bound to specific environment classes. There's no clean path for "run this Python in the sandbox my user chose, with these libraries available, and hand me back the files it produced." The motivating use case: user asks for a plot, Granite 4.1 emits code, the code runs in the chosen sandbox, matplotlib writes a PNG, and the PNG comes back as a structured artifact.
Acceptable implementation
- A configurable Python tool that replaces the current helpers. The existing helpers can stay as thin backwards-compat wrappers for one release.
- Validated against
matplotlib,numpy, andpandas. If these aren't in the default sandbox image, pick and document a package-install story (prebuilt image, on-demand install, cached venv, etc.) and exercise it in tests. matplotlib.use('Agg')(or equivalent) configured automatically so plots don't try to display interactively.- A convention for the expected output directory; created files surfaced as structured artifact metadata (path, size, content type) on the execution result.
- At least one runnable example per canonical task: arithmetic, CSV summary, matplotlib plot saved to file.
Design questions worth resolving
- Does the Python tool become a new
Component, or stay a function wrapped inMelleaTool? This affects how requirements compose on top of it. - Where does "please install
seabornfor this execution" live — tool config, capability policy, or the requirement/repair layer? - Per-execution tempdir vs. a stable artifact directory the user can point at?
Activity