Support catalog templates for approved command prefixes (#55366)

## What changed

Add `approved_prefixes` to catalog permission messages, with `{{ approved_prefixes }}` substitution for the approved command list. An empty template suppresses the section; missing or null values retain the bundled template.

For `on-request` approvals, append an explicitly supplied prefix template even when the catalog also supplies approval instructions. Use the template for bundled `on-request` and granular approval instructions as well.

## Testing

Extend the remote model catalog integration test to cover custom prefix rendering alongside catalog approval instructions and suppression with an empty template.

GitOrigin-RevId: 82dd6f83caa56cab0a2f6343bf912efe2cb97d64
This commit is contained in:
Dylan Hurd
2026-10-19 19:55:39 +00:00
committed by copyberry
parent ee8b4ea181
commit d9a36f6ec7
10 changed files with 125 additions and 51 deletions
@@ -268,6 +268,7 @@ fn permissions_state(
danger_full_access: Some("Full access.".to_string()),
workspace_write: Some("Workspace write.".to_string()),
read_only: Some("Read only.".to_string()),
approved_prefixes: None,
};
let mut model = model_info_from_slug("test-model");
model.model_messages = Some(ModelMessages {