Skip to content

Report withheld run_python files as received; ask for local chart labels - #271

Merged
iamwavecut merged 1 commit into
mainfrom
fix/run-python-safe-delivery-labels
Oct 20, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
fix/run-python-safe-delivery-labels

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Problem

After #270, the production SAFE virtual dialog ran the chart script, and send_withheld listed sales_chart.png, so auto-delivery works. Two problems remained:

  1. The tool message in SAFE mode was only "The script finished.", so Gemma replied with the bare text send_files=["sales_chart.png"], as if it still had to send the chart. In a real chat the message says the chat received the file. SAFE mode therefore did not reproduce real behavior, unlike the other SAFE tools, which fake a successful delivery (draw_api returns delivered: true).
  2. Chart titles and labels stayed in English for a Russian request, although the code description asks for the user's language.

Change

  • A withheld delivery now produces the same message as a real one ("The script finished; the chat received …"). send_withheld still names the files for operators.
  • prompts/aifarm/system.prompt: the existing run_python sentence gains one instruction: "Заголовки, подписи и текст на графиках пиши на языке собеседника." Partials, role markers and template variables are unchanged.

Verification

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p openplotva-app (1434 passed), -p openplotva-prompts (9), -p openplotva-llm (218)

After the deploy, the production SAFE virtual dialog will repeat the chart request and a follow-up edit.

Deployment risk

The prompt edit rebuilds the cached system prefix once. Rollback: revert this commit.

A SAFE virtual dialog told the model only "The script finished." after
a withheld delivery, so Gemma kept writing send_files=[...] into its
reply as if it still had to send the chart. The withheld files now read
as received, like the other SAFE tools that fake delivery, so test
dialogs continue the way a real chat does.

Gemma also kept English chart labels for Russian requests although the
tool description asked otherwise; the run_python line of the system
prompt now asks for titles and labels in the user's language.
@github-actions

Copy link
Copy Markdown
Warnings
⚠️ Prompt files are cache-sensitive contracts; confirm prompt shape and role markers were preserved intentionally.
Messages
📖 Danger checked 2 changed file(s).

Generated by 🚫 dangerJS against c61701b

@iamwavecut

Copy link
Copy Markdown
Owner Author

Danger prompt warning: intentional. The change adds one sentence to the existing run_python line inside <agent_behavior> of prompts/aifarm/system.prompt. Partials, role markers and template variables are unchanged, and cargo test -p openplotva-prompts passes. The cached system prefix is rebuilt once after the deploy.

@iamwavecut
iamwavecut merged commit ddb0626 into main Oct 20, 2026
12 checks passed
@iamwavecut
iamwavecut deleted the fix/run-python-safe-delivery-labels branch October 20, 2026 17:31
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