mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Relax hooks.json top-level metadata validation (#30229)
## Summary - Allow a top-level `description` string in `hooks.json`. - Continue rejecting unknown top-level keys and root-level hook events; events must remain under `hooks`. ## Testing - `just test -p codex-config`
This commit is contained in:
1 parent
914c8eeb4e
commit
2c5bc5e284
2 files changed
+4
No files matched your search
@@ -13,6 +13,7 @@ use super::MatcherGroup;
|
||||
fn hooks_file_deserializes_existing_json_shape() {
|
||||
let parsed: HooksFile = serde_json::from_str(
|
||||
r#"{
|
||||
"description": "Optional stop-time review gate for Codex Companion.",
|
||||
"hooks": {
|
||||
"PreToolUse": [
|
||||
{
|
||||
@@ -35,6 +36,7 @@ fn hooks_file_deserializes_existing_json_shape() {
|
||||
assert_eq!(
|
||||
parsed,
|
||||
HooksFile {
|
||||
description: Some("Optional stop-time review gate for Codex Companion.".to_string()),
|
||||
hooks: HookEventsToml {
|
||||
pre_tool_use: vec![MatcherGroup {
|
||||
matcher: Some("^Bash$".to_string()),
|
||||
|
||||
Reference in new issue
Block a user