feat(core) Introduce Feature::RequestPermissions (#11871)

## Summary
Introduces the initial implementation of Feature::RequestPermissions.
RequestPermissions allows the model to request that a command be run
inside the sandbox, with additional permissions, like writing to a
specific folder. Eventually this will include other rules as well, and
the ability to persist these permissions, but this PR is already quite
large - let's get the core flow working and go from there!

<img width="1279" height="541" alt="Screenshot 2026-02-15 at 2 26 22 PM"
src="https://github.com/user-attachments/assets/0ee3ec0f-02ec-4509-91a2-809ac80be368"
/>

## Testing
- [x] Added tests
- [x] Tested locally
- [x] Feature
This commit is contained in:
Dylan Hurd
2026-02-24 09:48:57 -08:00
committed by GitHub
parent 9a8adbf6e5
commit f6053fdfb3
43 changed files with 1471 additions and 77 deletions

View File

@@ -2776,6 +2776,7 @@ async fn exec_approval_emits_proposed_command_and_decision_history() {
network_approval_context: None,
proposed_execpolicy_amendment: None,
proposed_network_policy_amendments: None,
additional_permissions: None,
parsed_cmd: vec![],
};
chat.handle_codex_event(Event {
@@ -2823,6 +2824,7 @@ async fn exec_approval_decision_truncates_multiline_and_long_commands() {
network_approval_context: None,
proposed_execpolicy_amendment: None,
proposed_network_policy_amendments: None,
additional_permissions: None,
parsed_cmd: vec![],
};
chat.handle_codex_event(Event {
@@ -2876,6 +2878,7 @@ async fn exec_approval_decision_truncates_multiline_and_long_commands() {
network_approval_context: None,
proposed_execpolicy_amendment: None,
proposed_network_policy_amendments: None,
additional_permissions: None,
parsed_cmd: vec![],
};
chat.handle_codex_event(Event {
@@ -6474,6 +6477,7 @@ async fn approval_modal_exec_snapshot() -> anyhow::Result<()> {
"world".into(),
])),
proposed_network_policy_amendments: None,
additional_permissions: None,
parsed_cmd: vec![],
};
chat.handle_codex_event(Event {
@@ -6533,6 +6537,7 @@ async fn approval_modal_exec_without_reason_snapshot() -> anyhow::Result<()> {
"world".into(),
])),
proposed_network_policy_amendments: None,
additional_permissions: None,
parsed_cmd: vec![],
};
chat.handle_codex_event(Event {
@@ -6579,6 +6584,7 @@ async fn approval_modal_exec_multiline_prefix_hides_execpolicy_option_snapshot()
network_approval_context: None,
proposed_execpolicy_amendment: Some(ExecPolicyAmendment::new(command)),
proposed_network_policy_amendments: None,
additional_permissions: None,
parsed_cmd: vec![],
};
chat.handle_codex_event(Event {
@@ -6944,6 +6950,7 @@ async fn status_widget_and_approval_modal_snapshot() {
"hello world".into(),
])),
proposed_network_policy_amendments: None,
additional_permissions: None,
parsed_cmd: vec![],
};
chat.handle_codex_event(Event {