Repository navigation
fix(agents): a Full access desktop chat is told how to approve a gated command - #5555
kovtcharov wants to merge 1 commit into
Conversation
…ommand In an Agent UI chat set to Full access, a gated shell command such as a delete was refused with "turn on full access", which was already on. Over the agent sidecar's socket Full access keeps the shell gates on (amd#3373), so the refusal now says so and points to Ask mode, where the command gets a real approval prompt.
|
Verdict: Approve In a desktop chat already set to Full access, the refusal for a gated command (like deleting a file) told the user to "turn on full access", which was already on. Now it tells them to switch the chat to Ask, which is the mode where GAIA actually asks before running the command. The new wording only shows when someone is watching a Full access desktop chat. Unattended auto-approve runs keep the old text, and the TUI's Full access never reaches this message because it lifts the shell gates. Real-world evidenceN/A: no evidence bundle was produced for this run. Only the refusal text the agent reads changes, so this verdict rests on static review plus the author's unit-test results. The author has already listed 🔍 Technical detailsIssues 🟢 The code comment carries an issue number ( Checked, no action needed
Strengths
|
|
Superseded by #5562: a Full access desktop chat now asks before a gated shell command instead of refusing it, so the reworded refusal here is no longer needed. |
…p chat (amd#5562) Before: a desktop (Agent UI) chat set to Full access couldn't run a delete, `git add`, or any other command that needs approval. GAIA refused it and told the user to turn on Full access, which was already on. After: GAIA shows the normal approval prompt for that command (Allow once / Deny, plus "always" where it's offered) and runs it only if the user allows. Commands that never need approval still run without asking, and a command that needs approval still never runs unasked through the desktop app's agent connection. This replaces amd#5555, which only reworded the refusal. That case now gets a prompt, so amd#5555 can be closed. ## Test plan - [ ] `pytest tests/unit/test_shell_prompt_instead_of_refuse.py tests/unit/test_relay_tool_confirmation.py` passes. New cases cover: a Full access chat asks about a gated command and runs it only after Allow; Deny means it doesn't run; a one-time line is asked once; a safe command runs unasked; an unwatched run, `GAIA_AUTO_APPROVE_TOOLS`, and a direct tool call all still refuse without prompting; the model can't pass the marker itself; the live sidecar relays the prompt to the Agent UI and acts on its answer. - [ ] `pytest tests/unit -k "shell or permission or confirm or approval or relay" -n 4`: the same 3 Windows-only failures fail on `origin/main` too (`cat`/compound-line tests). - [ ] Manual: in the Agent UI with the flagship running as a sidecar, set a chat to Full access and ask it to delete a scratch file. A prompt appears. Deny leaves the file; Allow deletes it. `git status` still runs with no prompt. - [ ] Eval categories to watch on the next RC: `gaia_tool_selection`, `error_recovery`. <details> <summary>🔍 Technical details</summary> - Over HTTP, Full access sets `auto_approve_gated_tools=True` with `full_access=False`, so the shell gates stay on (amd#3373). The shell pre-flight used to refuse every gated call when the only approval on hand was blanket. - Now, when the console says a person can answer (`answers_confirmations` and `grants_paths` are True, `full_access` is False, it isn't in background mode, the `GAIA_AUTO_APPROVE_TOOLS` env var isn't set, and the handler declares `asks_past_preapproval`), the pre-flight records the call. `confirmation_args_for_call` adds the reserved `NEEDS_PERSON_ARG`. - `SSEOutputHandler.confirm_tool_execution` removes the marker before anything is emitted. For a marked call it skips auto-approve, which is the same pattern as the existing `widens_scope` exception, and it denies when `answers_confirmations` is False. - On the execution path, a call counts as confirmed only if `note_confirmed_call` recorded an approval for exactly that `(command, working_directory)`. A direct tool call, or a call whose approval was auto-approved, is still refused by `_nothing_could_have_confirmed`. - `_execute_tool` rejects the marker if the model sends it, and treats a marked call like a one-time call, so the reroute question can't stand in for the real prompt. `wait_for_condition` is not marked and still refuses. - The sidecar's HTTP routes and schemas don't change, so the OpenAPI spec doesn't need regenerating. What changes is behaviour: under `/bypass`, a gated shell call on an answerable run now emits `needs_confirmation`. `SPEC.md`, `SKILL.md` and `CHANGELOG.md` in `hub/agents/gaia/npm` describe it. </details> Co-authored-by: Kalin Ovtcharov <[email protected]>
In a desktop chat set to Full access, asking GAIA to delete a file failed with "needs your approval … or turn on full access", although Full access was already on, and replying "yes, run it" didn't help. The refusal pointed at a switch that was already on and left no way forward. It now says Full access in this chat doesn't cover commands like this one and to switch the chat to Ask, where GAIA asks and the command can run.
Test plan
pytest tests/unit/test_shell_prompt_instead_of_refuse.py: 50 passed; the new Full access desktop-chat case fails on mainpytest tests/unit -k "shell or permission or confirm or approval": 2150 passedpython util/lint.py --black --isortgaia_tool_selectionanderror_recovery(the refusal text the model reads changed)🔍 Technical details
PermissionState(lifts_shell_gates=False)applies Full access asauto_approve_gated_tools+grants_paths, neverfull_access(feat(shell): let --bypass-permissions lift the shell operator block #3373). A gated command therefore hits_blanket_approval_refusal. The new branch fires only whengrants_pathsandanswers_confirmationsare both set, which is a person watching a Full access chat; an unattendedGAIA_AUTO_APPROVE_TOOLSrun keeps its old wording.