# acp_thread: Add generic permission prompts \(\#65080\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 3209c7d31f93d0076759a993dd62878e44943230

Requested commit: 3209c7d31f93d0076759a993dd62878e44943230

Commit: 3209c7d31f93d0076759a993dd62878e44943230

Tree: 632fdb9369e5b19044a7c2fb97c5203d38ae696f

Author: Ben Brandt

Committer: GitHub

## Message

```
acp_thread: Add generic permission prompts (#65080)

Extend the request-owned permission model from merged #65039 to typed
ACP v2 permission requests and a minimal request-owned UI. This is a
shared-model/UI foundation, **not v2 wire enablement**.

- Retain the complete SDK request: title, description, subject, offered
options, unknown option kinds, and request/subject/option metadata.
Legacy tool permissions remain a separate variant in the same
authoritative pending-request store.
- Validate the owning session and nonempty, unique offered IDs before
insertion. Multiple requests for the same subject coexist under distinct
local request IDs; subjects never create or update tool history.
- Return the exact explicitly selected SDK option ID, including for
unknown kinds. Do not infer approval from unknown hints or apply legacy
tool-progress policy to generic choices. Selection and cancellation
target the exact session/request record.
- Render plain-text generic cards in the existing permission area
without transcript anchors or scroll-to-tool behavior. Root views
include child requests even without a spawning-tool anchor; standalone
child views remain session-scoped.
- Preserve legacy flat/dropdown/pattern controls, parameters,
grant-versus-action-choice behavior, and grouped request ordering. A
generic-first request blocks legacy shortcuts rather than allowing them
to skip to a later tool request. Generic records do not enter legacy
selection caches, authorization telemetry, tool counts, or scroll
summaries.
- Notify on registration/hydration and new permission requests so late
or unanchored child prompts do not depend on unrelated rendering events.
Bound long option controls and provide full-name tooltips.

## Review guide

Most added lines are regression tests. The production boundary stays in
the existing owners:

1. [Request
ownership](https://github.com/zed-industries/zed/blob/d2e2870906800e9c34244b4aff30fbc561ceb8d4/crates/acp_thread/src/acp_thread.rs#L1055),
[typed
insertion/selection](https://github.com/zed-industries/zed/blob/d2e2870906800e9c34244b4aff30fbc561ceb8d4/crates/acp_thread/src/acp_thread.rs#L5462),
and [canonical
settlement](https://github.com/zed-industries/zed/blob/d2e2870906800e9c34244b4aff30fbc561ceb8d4/crates/acp_thread/src/acp_thread.rs#L5708).
2. [Conversation
hydration/invalidation](https://github.com/zed-industries/zed/blob/d2e2870906800e9c34244b4aff30fbc561ceb8d4/crates/agent_ui/src/conversation_view.rs#L296)
and [legacy-only tool
counts](https://github.com/zed-industries/zed/blob/d2e2870906800e9c34244b4aff30fbc561ceb8d4/crates/agent_ui/src/conversation_view.rs#L521);
the shared pending selector retains its generic-first barrier.
3. [Generic cards and exact-ID
callbacks](https://github.com/zed-industries/zed/blob/d2e2870906800e9c34244b4aff30fbc561ceb8d4/crates/agent_ui/src/conversation_view/thread_view.rs#L3767),
including bounded controls with complete-label tooltips.
4. [Lifecycle
regressions](https://github.com/zed-industries/zed/blob/d2e2870906800e9c34244b4aff30fbc561ceb8d4/crates/acp_thread/src/acp_thread.rs#L20594),
[narrow-card
geometry](https://github.com/zed-industries/zed/blob/d2e2870906800e9c34244b4aff30fbc561ceb8d4/crates/agent_ui/src/conversation_view.rs#L15075),
and [rendered
late-registration/deduplication](https://github.com/zed-industries/zed/blob/d2e2870906800e9c34244b4aff30fbc561ceb8d4/crates/agent_ui/src/conversation_view.rs#L15389).

Release Notes:

- N/A
```

## Parents

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

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