Support catalog messages for non-request approval policies (#34434)

## What changed

- Add model-catalog approval message variants for `never` and `unless_trusted`.
- Select the catalog message that matches the active approval policy, while retaining the existing built-in text when that variant is absent.
- Treat an explicitly empty variant as an instruction to suppress the built-in approval text, consistent with `on_request` messages.

## Testing

- Cover variant selection, fallback and empty-message behavior, catalog deserialization, and the initial permissions message sent to the model.

GitOrigin-RevId: a0f8d41a08645f39b80093be53f200eeee18ca25
This commit is contained in:
rhan-oai
2026-07-21 00:22:31 +00:00
committed by copyberry
parent fd3c1dc13d
commit 2be7d3bcd9
6 changed files with 135 additions and 11 deletions
@@ -72,6 +72,8 @@ fn permissions_state(
let approval_messages = ApprovalMessages {
on_request: Some("Ask for approval.".to_string()),
on_request_auto_review: None,
never: None,
unless_trusted: None,
};
let permission_messages = PermissionMessages {
danger_full_access: Some("Full access.".to_string()),