Files
Mert Koseoglu 675fec69c9 fix(codex): drop look-around from PreToolUse matcher (closes #547 partial — 1 of 1)
v1.0.124 shipped Codex matchers containing `(?!.*context-mode)` and
`(?!plugin_context-mode_)`. Codex's Rust `regex` crate does NOT support
look-around, so it rejects the matcher at boot with "look-around not
supported" — every Codex user on v1.0.124 is broken. Pin Codex matchers
to charset `[A-Za-z0-9_|]` so `is_exact_matcher`
(refs/platforms/codex/codex-rs/hooks/src/events/common.rs:152)
short-circuits the regex engine entirely. Hook BODY's `isExternalMcpTool()`
filter (hooks/core/routing.mjs:379) preserves end-to-end semantics.

RED→GREEN: tests/adapters/codex.test.ts "Codex matcher #547 — is_exact_matcher charset compliance"
2026-05-13 16:28:42 +03:00

48 lines
1.1 KiB
JSON

{
"hooks": {
"PreToolUse": [
{
"matcher": "local_shell|shell|shell_command|exec_command|Bash|Shell|apply_patch|Edit|Write|grep_files|ctx_execute|ctx_execute_file|ctx_batch_execute|ctx_fetch_and_index|ctx_search|ctx_index|mcp__",
"hooks": [
{ "type": "command", "command": "context-mode hook codex pretooluse" }
]
}
],
"PostToolUse": [
{
"hooks": [
{ "type": "command", "command": "context-mode hook codex posttooluse" }
]
}
],
"SessionStart": [
{
"hooks": [
{ "type": "command", "command": "context-mode hook codex sessionstart" }
]
}
],
"PreCompact": [
{
"hooks": [
{ "type": "command", "command": "context-mode hook codex precompact" }
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{ "type": "command", "command": "context-mode hook codex userpromptsubmit" }
]
}
],
"Stop": [
{
"hooks": [
{ "type": "command", "command": "context-mode hook codex stop" }
]
}
]
}
}