Repository navigation
fix(tui): Python runners and CLI setup get honest confirmation badges - #4542
Conversation
A read-only pandas groupby run through run_python was badged DESTRUCTIVE and told it 'may not be reversible': run_python, execute_python_file, wait_for_condition, install_cli, sign_in_cli and notify_desktop were gated by the agent but missing from the TUI's risk table, so they fell to the cautious default. Code runners now say what is true - code can do anything, check it - and a test fails when a gated tool has no tier.
|
Verdict: Approve with suggestions This stops the terminal UI from telling people a read-only Python calculation "may not be reversible", gives the six missing tools a proper risk level, and adds a test that fails the next time a gated tool is left out. It's a small, well-tested fix and safe to merge. One wording problem: for running a Python file, the new warning says "check the code above", but the prompt only shows the file path, not the file's contents. The user is told to check something they can't see. Give that tool its own wording, e.g. "check the script before approving". Real-world evidenceN/A — no evidence bundle was produced for this run. The PR description reports a live TUI check (local Qwen3-30B: 🔍 Technical detailsIssues 🟡 "Check the code above" doesn't fit Then add a case in case "script":
return "A Python script can read, change, or delete anything you can — " +
"check what the file does before approving."Also update 🟢 The coverage test parses Go source text ( Strengths
|
Asking the flagship for a region total from a CSV raised a red DESTRUCTIVE prompt that said a read-only pandas
groupby"may not be reversible". Six tools the agent gates (run_python,execute_python_file,wait_for_condition,install_cli,sign_in_cliandnotify_desktop) were missing from the TUI's risk table, so they fell to the cautious default. A warning that is false on safe calls teaches people to approve without reading.Code runners keep the cautious tier but now say what's true: Python code can read, change, or delete anything you can — check the code above before approving. CLI setup and desktop notifications are Write. A new test fails whenever a tool in
TOOLS_REQUIRING_CONFIRMATIONhas no tier. It caughtnotify_desktop, which wasn't in the original bug report.Test plan
go test ./internal/ui/components/pytest tests/unit/agents/test_confirmation_required_tools.py4.Overlap with #4461: that PR moves risk to a per-call
riskfield from the agent and adds a RUNS CODE tier for the two Python tools, which is better for those two. This PR is the small fix that ships now. Its coverage test and theinstall_cli,sign_in_cli,notify_desktopandwait_for_conditiontiers still apply after #4461. Whichever merges second should take #4461'sRiskExecutefor the Python tools.