Repository navigation
fix(serve): send only the model's tool arguments in needs_confirmation - #5645
Conversation
A policy client auto-approving gated calls on needs_confirmation `args` was matching on fields the model never sent: the agent's risk note, its scratch-folder marker, and the folder it fills in for a shell call. `args` is now exactly the call's arguments as the model sent them. - The agent notes the model's arguments on the handler before it asks, and the permission_request carries them as `call_args`; the translator emits those as `args`. A prompt the agent raises itself (path access) drops only the prompt-only keys. - The folder and risk note move to a new `prompt_context` object, and the Agent UI relay folds them back into the card's args, so a relayed prompt still shows them. - The flagship OpenAPI now documents the /query stream, and README, SPEC, SKILL, CHANGELOG and the SSE contract spec describe `args`, `args_truncated` and `prompt_context` the same way. Lands in the unreleased contract 2.19, so no version bump. Closes amd#5361
… call A gated write or code call whose prompt matched the model's arguments carried its whole content twice in the Agent UI's permission event. call_args is now sent only when the prompt shows more than the model sent; the translator already falls back to args when it is absent.
|
Verdict: Approve with suggestions A client that approves tool calls by policy now sees only what the model actually sent in a confirmation's Nothing blocks merge. One small gap: when the agent asks for confirmation without recording what the model sent, a folder GAIA added can still end up in Real-world evidenceN/A here: no 🔍 Technical detailsIssues 🟢 A host-added folder can still reach 🟢 Name the consumer of Checked and fine
Strengths
|
A prompt that arrives without call_args keeps working_directory in args. Only the agent's tool-execution path adds a folder, and it always records the model's call first, so any other folder is the model's own. The docstrings now say so and name the translator as call_args' only reader.
|
Good catch to pin. A prompt that arrives without the recorded call now has a test that keeps its folder in 🔍 Technical details
|
A client that approves or denies tool calls by policy saw arguments in
needs_confirmationthat the model never sent. GAIA folded in its own fields: the folder a shell command runs in, a risk note, and an internal scratch marker. So a rule could match on GAIA's additions instead of on what the model asked to do. Nowargsis exactly the model's call. GAIA's display extras move to a new optionalprompt_contextobject, and the Agent UI still shows them on the approval card.Closes #5361
args,args_truncatedandprompt_contextare now documented the same way in the OpenAPI file, README, SPEC, SKILL, CHANGELOG and the SSE contract spec. The spec'sneeds_confirmationschema had also been missing several existing fields.argswas introduced, so there's no separate version bump.Test plan
/v1/gaia/queryon a local Lemonade (Qwen3.6),git log -1 --output=gitlog.txt: on main,argscarriedworking_directoryand_risk_note. On this branch,argsis{"command": "git log -1 --output=gitlog.txt"}and the folder and note are inprompt_context.util/lint.py --black --isort --flake8 --pylintpasses