# agent_ui: Track existing permissions when registering threads \(\#64644\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f2aa97c47f9cce0cd28dd61552efae49a39c72b4

Requested commit: f2aa97c47f9cce0cd28dd61552efae49a39c72b4

Commit: f2aa97c47f9cce0cd28dd61552efae49a39c72b4

Tree: e47bf530500e52dbf55fdeebad25c34e674f9d67

Author: Ben Brandt

Committer: GitHub

## Message

```
agent_ui: Track existing permissions when registering threads (#64644)

Discover permission requests that are already pending when a thread is
registered with a conversation. Previously, registration only subscribed
to future authorization events, so a waiting tool call could exist in
the thread but remain absent from the conversation's pending-request
lookup and subagent permission counts.

- Seed tracking from existing `WaitingForConfirmation` tool calls in
entry order.
- Use the same deduplicating insertion path for initial state and
subsequent request events, preserving already-tracked order.
- Leave authorization-received removal, conversation-wide shortcut
policy, and preview interaction unchanged.

Not really an issue in practice for the zed agent, but will be
potentially for ACP v2

Release Notes:

- N/A
```

## Parents

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

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