Use Bash for network approval hook payloads

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Abhinav Vedmala
2026-04-13 16:37:18 -07:00
parent 04294e0038
commit 75cc778393
2 changed files with 3 additions and 5 deletions

View File

@@ -37,8 +37,6 @@ use tokio::sync::RwLock;
use tracing::warn;
use uuid::Uuid;
const NETWORK_ACCESS_HOOK_TOOL_NAME: &str = "NetworkAccess";
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(crate) enum NetworkApprovalMode {
Immediate,
@@ -389,7 +387,7 @@ impl NetworkApprovalService {
&turn_context,
&guardian_approval_id,
PermissionRequestPayload {
tool_name: NETWORK_ACCESS_HOOK_TOOL_NAME.to_string(),
tool_name: "Bash".to_string(),
command,
description: Some(format!("network-access {}", request.host)),
},

View File

@@ -1340,7 +1340,7 @@ allow_local_binding = true
.with_pre_build_hook(|home| {
if let Err(error) = write_permission_request_hook(
home,
Some("^NetworkAccess$"),
Some("^Bash$"),
"allow",
"should not be used for allow",
) {
@@ -1435,7 +1435,7 @@ allow_local_binding = true
let hook_inputs = read_permission_request_hook_inputs(test.codex_home_path())?;
assert_eq!(hook_inputs.len(), 1);
assert_eq!(hook_inputs[0]["hook_event_name"], "PermissionRequest");
assert_eq!(hook_inputs[0]["tool_name"], "NetworkAccess");
assert_eq!(hook_inputs[0]["tool_name"], "Bash");
assert_eq!(hook_inputs[0]["tool_input"]["command"], command);
assert_eq!(
hook_inputs[0]["tool_input"]["description"],