Use the server permission catalog for TUI permission shortcuts (#50140)

## Why

Permission shortcuts checked local configuration while the picker used the connected server's catalog and requirements. Shortcuts should respect the same server restrictions, including model-specific auto-review requirements.

## What changed

- Share a cached server catalog between the permission picker and shortcuts. Show the loading picker when no catalog is available and reuse an outstanding fetch.
- Clear the cache on session, account, working-directory, or connection changes.
- Give discovery RPCs distinct request IDs for each fetch and profile page so repeated requests after timeouts do not collide.

## Testing

Add coverage for loading and catalog reuse, managed permission restrictions, and refetching after disconnect. Update timeout coverage to verify that repeated discovery attempts use distinct IDs and each reports a timeout.

GitOrigin-RevId: 7d79874294136bfe3a654bb306eb7caf36d4df1e
This commit is contained in:
Eric Traut
2026-10-02 01:34:23 +00:00
committed by copyberry
parent 8d44977aa2
commit cb6da58876
13 changed files with 141 additions and 57 deletions
@@ -127,6 +127,7 @@ impl ChatWidget {
model_catalog,
model_popup_request_id: None,
permission_popup_request_id: None,
permission_discovery: None,
worktree_popup_request_id: None,
permission_profiles_menu_opened: false,
model_popup_model_ids: Vec::new(),