Repository navigation
Send the files a run_python call changed when send_files is omitted - #270
Merged
Merged
Conversation
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.
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.
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 wrotesend_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 withoutsend_filesdelivers every non-empty file it created or changed (the supervisor'schangedflag; 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 insend_files. Explicitsend_fileswork as before.PythonRunRequest.withhold_delivery: the SAFE virtual-dialog toolbox sets it, and the result lists the files that would have been sent assend_withheld. Before this change, the SAFE wrapper could only withhold explicitsend_files.send_filesdescription says that omitting it sends every created or changed file; the tool result text says the same; thecodedescription asks for titles and labels in the user's language.Verification
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test -p openplotva-app(1434 passed, including newruns_without_send_files_deliver_the_files_they_changedandtoo_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_withheldlists the chart and that the reply contains no protocol text.Deployment risk
Scripts that write helper files without naming
send_filesnow send those files too, at most 10 per call. Rollback: revert this commit, or unsetSANDBOX_URLto remove the tool.