Skip to content

Send the files a run_python call changed when send_files is omitted - #270

Merged
iamwavecut merged 1 commit into
mainfrom
fix/run-python-auto-send
Oct 20, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
fix/run-python-auto-send

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Problem

After #269, a SAFE runtime virtual dialog on production asked for a bar chart. Gemma ran the script twice, and both runs succeeded and saved a PNG. Neither call passed send_files. Instead, Gemma wrote send_files=["sales_chart_final.png"] into its text reply, so in a real chat the user would get that protocol text and no chart. The chart labels were also in English for a Russian request.

Change

  • PythonSandboxTool::run: a successful run without send_files delivers every non-empty file it created or changed (the supervisor's changed flag; input files written before the run do not count). When more than 10 files changed, nothing is sent and the result message asks the model to name the files in send_files. Explicit send_files work as before.
  • PythonRunRequest.withhold_delivery: the SAFE virtual-dialog toolbox sets it, and the result lists the files that would have been sent as send_withheld. Before this change, the SAFE wrapper could only withhold explicit send_files.
  • Tool text: the send_files description says that omitting it sends every created or changed file; the tool result text says the same; the code description asks for titles and labels in the user's language.
  • The design doc is updated to match.

Verification

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p openplotva-app (1434 passed, including new runs_without_send_files_deliver_the_files_they_changed and too_many_changed_files_wait_for_send_files), -p openplotva-dialog (106), -p openplotva-llm (218)

After the deploy, the production SAFE virtual dialog will repeat the chart request and a follow-up edit. The check is that send_withheld lists the chart and that the reply contains no protocol text.

Deployment risk

Scripts that write helper files without naming send_files now send those files too, at most 10 per call. Rollback: revert this commit, or unset SANDBOX_URL to remove the tool.

In production Gemma ran the chart script but never passed send_files;
it wrote send_files=[...] into its reply instead, so the chart stayed in
the sandbox. A successful run without send_files now delivers every
non-empty file it created or changed. More than ten such files wait for
the model to name them, and the result says so.

SAFE runtime virtual dialogs set withhold_delivery and get the files
that would have been sent as send_withheld. The code description also
asks for titles and labels in the user's language.
@github-actions

Copy link
Copy Markdown
Messages
📖 Danger checked 5 changed file(s).

Generated by 🚫 dangerJS against 5a79de6

@iamwavecut
iamwavecut merged commit 889cccd into main Oct 20, 2026
12 checks passed
@iamwavecut
iamwavecut deleted the fix/run-python-auto-send branch October 20, 2026 17:14
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