Merge branch 'codex/viyatb/hooks-trust-precedence' of github.com:openai/codex into codex/viyatb/pr15937-p3

This commit is contained in:
viyatb-oai
2026-04-16 16:55:51 -07:00
5 changed files with 9 additions and 11 deletions
-1
View File
@@ -2284,7 +2284,6 @@ version = "0.0.0"
dependencies = [
"anyhow",
"chrono",
"codex-app-server-protocol",
"codex-config",
"codex-protocol",
"codex-utils-absolute-path",
+1 -1
View File
@@ -752,7 +752,7 @@ impl MessageProcessor {
| ClientRequest::TurnSteer { request_id, .. } = &codex_request
{
self.analytics_events_client.track_request(
connection_request_id.connection_id.0,
connection_id.0,
request_id.clone(),
codex_request.clone(),
);
-1
View File
@@ -15,7 +15,6 @@ workspace = true
[dependencies]
anyhow = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
codex-app-server-protocol = { workspace = true }
codex-config = { workspace = true }
codex-protocol = { workspace = true }
codex-utils-absolute-path = { workspace = true }
+4 -4
View File
@@ -397,15 +397,15 @@ mod tests {
(
"cmd.exe".to_string(),
vec!["/D".to_string(), "/C".to_string()],
r#"echo {^"continue^":false,^"stopReason^":^"pause^",^"hookSpecificOutput^":{^"hookEventName^":^"SessionStart^",^"additionalContext^":^"trusted context^"}}"#.to_string(),
"type nul > project-ran && echo project context".to_string(),
r#"more > nul && echo {^"continue^":false,^"stopReason^":^"pause^",^"hookSpecificOutput^":{^"hookEventName^":^"SessionStart^",^"additionalContext^":^"trusted context^"}}"#.to_string(),
"more > nul && type nul > project-ran && echo project context".to_string(),
)
} else {
(
"/bin/sh".to_string(),
vec!["-c".to_string()],
"printf '%s' '{\"continue\":false,\"stopReason\":\"pause\",\"hookSpecificOutput\":{\"hookEventName\":\"SessionStart\",\"additionalContext\":\"trusted context\"}}'".to_string(),
"touch project-ran && printf 'project context'".to_string(),
"cat >/dev/null; printf '%s' '{\"continue\":false,\"stopReason\":\"pause\",\"hookSpecificOutput\":{\"hookEventName\":\"SessionStart\",\"additionalContext\":\"trusted context\"}}'".to_string(),
"cat >/dev/null; touch project-ran && printf 'project context'".to_string(),
)
};
let handlers = vec![
@@ -454,15 +454,15 @@ mod tests {
(
"cmd.exe".to_string(),
vec!["/D".to_string(), "/C".to_string()],
r#"echo {^"decision^":^"block^",^"reason^":^"slow down^",^"hookSpecificOutput^":{^"hookEventName^":^"UserPromptSubmit^",^"additionalContext^":^"trusted context^"}}"#.to_string(),
"type nul > project-ran && echo project context".to_string(),
r#"more > nul && echo {^"decision^":^"block^",^"reason^":^"slow down^",^"hookSpecificOutput^":{^"hookEventName^":^"UserPromptSubmit^",^"additionalContext^":^"trusted context^"}}"#.to_string(),
"more > nul && type nul > project-ran && echo project context".to_string(),
)
} else {
(
"/bin/sh".to_string(),
vec!["-c".to_string()],
"printf '%s' '{\"decision\":\"block\",\"reason\":\"slow down\",\"hookSpecificOutput\":{\"hookEventName\":\"UserPromptSubmit\",\"additionalContext\":\"trusted context\"}}'".to_string(),
"touch project-ran && printf 'project context'".to_string(),
"cat >/dev/null; printf '%s' '{\"decision\":\"block\",\"reason\":\"slow down\",\"hookSpecificOutput\":{\"hookEventName\":\"UserPromptSubmit\",\"additionalContext\":\"trusted context\"}}'".to_string(),
"cat >/dev/null; touch project-ran && printf 'project context'".to_string(),
)
};
let handlers = vec![