Repository navigation
fix(agent): a declined write is a finished answer, not unfinished work - #4693
Conversation
When the user said no to a file write, the completion check still counted the save as missing. It told the model to write the file again at an invented cwd path, which raised a second permission prompt, and then replaced the model's honest "you denied it" reply with "Treat it as unfinished". - A write turned down by the confirmation prompt or the path allowlist is recorded. If the answer says it wasn't saved, the obligation is dropped. - A claim of success after a denial is still caught, and the reason given is the real one: "The write to `<path>` was declined, so nothing was saved there." - The correction for that case says not to retry the write anywhere. - A bare requested file name is shown as the name, not joined to the cwd.
|
Verdict: Approve with suggestions Clicking Deny on a file write now leaves the agent's honest "I couldn't save that" reply alone. Before, the reply was replaced with "treat it as unfinished", and the agent was pushed into a second, unrequested write prompt at a path the user never gave. A false "Saved!" after a denial is still caught, and now gets the real reason. The logic is tightly scoped and well tested. Two things remain before merge, and the PR already lists both as open:
Real-world evidenceN/A: no evidence bundle was produced for this run. The change affects the Agent UI and real inference, so it is deferred to the strix-halo lane. This verdict rests on static review of the diff alone. I could not run the unit tests here because pytest is not installed in the review environment. 🔍 Technical detailsIssues 🟡 Eval and UI evidence are still open (PR test plan). The answer gate in 🟢 🟢 The pathless-save exemption is not tied to the requested file ( Strengths
|
…urn-scope A declined write is a finished answer (amd#4693), so the completion check no longer widens the turn scope with the path the user said no to.
If you clicked Deny on a file write, the agent's honest reply ("I can't write to your Documents folder, you denied the permission") was replaced with "I can't confirm this is done … Treat it as unfinished — ask me to pick it up". That message also named a path the user never gave (
<cwd>\ui_notes.txtfor "ui_notes.txt in my Documents folder"). Worse, before replacing the reply, the completion check told the model to write the file at that invented path. That raised a second permission prompt the user hadn't asked for. Now a write the user turned down counts as a finished answer once the reply says it wasn't saved. A false "Saved!" is still caught and gets the real reason: "The write to…\Documents\ui_notes.txtwas declined, so nothing was saved there."🔍 Technical details
CompletionEvidencerecords write-tool calls that never ran because they were refused: confirmationstatus: "denied", or a validatorAccess denied:/User declined to overwriteerror. Preflight refusals such as "read it first" are not recorded.incomplete_answerreturns just those reasons, with no "complete the missing work" line.[check:completion]correction says not to retry the write anywhere. Before this change it said "Usewrite_filefor a missing requested save".DeniedEffects, which keys denials on the path, so a write of the same file elsewhere is not blocked. In this repro the second write came from the completion correction above, not from the model, so this PR removes that trigger. WideningDeniedEffectsto cover same-name writes belongs in fix(agent): a declined action is not run another way #4460.incomplete_answer.Test plan
python -m pytest tests/unit/agents/test_completion_evidence.py: the 9 new cases fail onorigin/main(src diff reverse-applied) and pass with the fix. The preflight guard case passes on both.python -m pytest tests/unit/agents: 2112 pass. The 1 failure,test_symlinked_directory_is_the_same_output, is an environment issue: WindowsWinError 1314(no symlink privilege). It is unrelated to this change.python util/lint.py --black --isortgaia eval agent --category gaia_files, andgaia_honesty, run serially on one Lemonade