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
3209c7d31fBen Brandt committed on 10/2/2026, 11:07:39 AM· committed by GitHubparent7362739
4 files changedLine totals unavailable