# agent: Propagate tool permission decisions to pending permission prompts \(\#54679\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/67e41996be88ecba7931a2f6546d5fa5a2b8902c)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 67e41996be88ecba7931a2f6546d5fa5a2b8902c

Requested commit: 67e41996be88ecba7931a2f6546d5fa5a2b8902c

Commit: 67e41996be88ecba7931a2f6546d5fa5a2b8902c

Tree: bd665210dcafc1c928e895732bf90bc5ed2c5218

Author: Tom Houlé

Committer: GitHub

## Message

```
agent: Propagate tool permission decisions to pending permission prompts (#54679)

When the agent issued several parallel tool calls that all required
confirmation, clicking "Always for en.wikipedia.org" (or similar) on the
first prompt would persist the new rule to settings but leave the
sibling prompts stuck waiting on their own oneshot channels. The same
happened across subagents, and whenever the user edited settings.json by
hand while prompts were on screen.

`ToolCallEventStream::authorize()` now takes full ownership of the
permission decision. It evaluates the tool-permission settings up front,
and on Confirm it spawns a task that races the user's response against a
`SettingsStore` observer. When settings change, it re-runs the decision;
a new Allow or Deny drops the response receiver, flips the tool call
status to dismiss the prompt UI, and resolves the task without user
input. Subagents fall out of this for free since each thread observes
`SettingsStore` independently.

A few tools (`copy_path`, `move_path`, `delete_path`,
`create_directory`, `save_file`, `restore_file_from_disk`, and the
`edit-file` helper) sometimes need to prompt even when settings say
Allow — for example, edits that target `.zed/settings.json`. For those,
a new `authorize_always_prompt()` method skips the settings check and
always waits for user input; tools pick between the two at the call site
based on whether the path is sensitive.

Closes #54101.

Release Notes:

- In the agent panel, when you click "Always allow" for a tool, this
decision now gets propagated to other pending calls to the same tool.

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
```

## Parents

- [7d42f276f2cca4e92d644d7b94f5639d45a8b59f](https://git.cafe/gitcafe/zed/commit/7d42f276f2cca4e92d644d7b94f5639d45a8b59f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/67e41996be88ecba7931a2f6546d5fa5a2b8902c?format=markdown)
