feat(tui): preselect suggested permission scope

Thread `suggestedScope` through the app-server permission approval
request and use it when constructing TUI approval requests. This
keeps the protocol backward compatible by defaulting the field to
`turn` when older clients omit it.

Add focused app-server and TUI coverage, plus a snapshot for the
session-suggested approval overlay so reviewers can see the
preselected session row.
This commit is contained in:
Felipe Coury
2026-04-13 13:15:18 -03:00
parent 097f431a88
commit bbf656dcf3
15 changed files with 171 additions and 9 deletions
+2 -1
View File
@@ -1079,7 +1079,7 @@ the client can offer session-scoped and/or persistent approval choices.
Clients must opt into conversational permission confirmation request methods by listing them in `initialize.params.capabilities.supportedServerRequests`. The opt-in is per connection and per method, which lets older clients continue to initialize without promising UI they do not implement.
The built-in `request_permissions` tool sends an `item/permissions/requestApproval` JSON-RPC request to the client with the requested permission profile. This v2 payload mirrors the command-execution `additionalPermissions` shape: it can request network access and additional filesystem access.
The built-in `request_permissions` tool sends an `item/permissions/requestApproval` JSON-RPC request to the client with the requested permission profile. This v2 payload mirrors the command-execution `additionalPermissions` shape: it can request network access and additional filesystem access, and it includes `suggestedScope` so clients can preselect the model's requested lifetime while still requiring explicit confirmation.
```json
{
@@ -1090,6 +1090,7 @@ The built-in `request_permissions` tool sends an `item/permissions/requestApprov
"turnId": "turn_123",
"itemId": "call_123",
"reason": "Select a workspace root",
"suggestedScope": "session",
"permissions": {
"fileSystem": {
"write": ["/Users/me/project", "/Users/me/shared"]