mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Add support for environment-scoped managed hooks (#56304)
## What changed - Add discovery and listing APIs for environment-owned required hooks, with command and MCP execution routed to the owning environment. - Use each environment's working directory in hook input, withhold controller transcript paths, and prevent environment hooks from granting permission requests. - Resolve `command_windows` against the environment's platform and, when hooks are enabled, reject unloadable required hooks before accepting environment configurations at startup or readiness. ## Testing Add regression coverage for invalid managed hook matchers at startup and readiness, successful readiness after correction, and per-hook working directory and transcript path scoping for `SubagentStop`. GitOrigin-RevId: 1ac0ab3778ba608c72e5917fcbaebcc1d454887f
This commit is contained in:
@@ -517,7 +517,9 @@ fn write_handler(temp: &TempDir, source: &str) -> ConfiguredHandler {
|
||||
|
||||
async fn schedule(runtime: &CommandHookRuntime, handler: ConfiguredHandler, cwd: &Path) {
|
||||
let engine = ClaudeHooksEngine {
|
||||
enabled: true,
|
||||
handlers: Arc::new(vec![handler]),
|
||||
hook_entries: Default::default(),
|
||||
warnings: Arc::default(),
|
||||
required_load_errors: Arc::default(),
|
||||
command_runtime: runtime.clone(),
|
||||
|
||||
Reference in New Issue
Block a user