Add permission suggestions to PermissionRequest hooks

Expose top-level permission suggestions in PermissionRequest hook inputs and build them from source approval context so deferred unified-exec network retries carry the same suggestion data as immediate approval paths.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Abhinav Vedmala
2026-04-13 19:21:19 -07:00
parent 7e4869308c
commit 91887885ee
13 changed files with 446 additions and 17 deletions

View File

@@ -22,6 +22,79 @@
"command"
],
"type": "object"
},
"PermissionSuggestion": {
"properties": {
"behavior": {
"$ref": "#/definitions/PermissionSuggestionBehavior"
},
"destination": {
"$ref": "#/definitions/PermissionSuggestionDestination"
},
"rules": {
"items": {
"$ref": "#/definitions/PermissionSuggestionRule"
},
"type": "array"
},
"type": {
"$ref": "#/definitions/PermissionSuggestionType"
}
},
"required": [
"behavior",
"destination",
"rules",
"type"
],
"type": "object"
},
"PermissionSuggestionBehavior": {
"enum": [
"allow",
"deny",
"ask"
],
"type": "string"
},
"PermissionSuggestionDestination": {
"enum": [
"session",
"projectSettings",
"userSettings"
],
"type": "string"
},
"PermissionSuggestionRule": {
"oneOf": [
{
"properties": {
"command": {
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"enum": [
"prefixRule"
],
"type": "string"
}
},
"required": [
"command",
"type"
],
"type": "object"
}
]
},
"PermissionSuggestionType": {
"enum": [
"addRules"
],
"type": "string"
}
},
"properties": {
@@ -45,6 +118,12 @@
],
"type": "string"
},
"permission_suggestions": {
"items": {
"$ref": "#/definitions/PermissionSuggestion"
},
"type": "array"
},
"session_id": {
"type": "string"
},