{"record":{"id":"97520363aeb342a6","repo":"openai/codex","slug":"failed-to-load-required-managed-hooks","errorCode":null,"errorMessage":"failed to load required managed hooks: {}","messagePattern":"failed to load required managed hooks: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/hooks/src/registry.rs","lineNumber":81,"sourceCode":"    engine: ClaudeHooksEngine,\n}\n\nimpl Hooks {\n    /// Bind this session's hook runtime and output files to its thread, rejecting unloadable\n    /// required managed hooks.\n    pub fn new(\n        config: HooksConfig,\n        thread_id: ThreadId,\n        mcp_executor: Arc<dyn HookMcpExecutor>,\n    ) -> anyhow::Result<(Self, Receiver<codex_protocol::protocol::HookCompletedEvent>)> {\n        let (result_sender, result_receiver) = async_channel::unbounded();\n        let environment = Arc::new(std::env::vars_os().collect());\n        let hooks = Self::from_config(config, mcp_executor, Arc::clone(&environment), |shell| {\n            CommandHookRuntime::new(shell, environment, thread_id, result_sender)\n        });\n        let required_load_errors = hooks.engine.required_load_errors();\n        if !required_load_errors.is_empty() {\n            anyhow::bail!(\n                \"failed to load required managed hooks: {}\",\n                required_load_errors.join(\"; \")\n            );\n        }\n        Ok((hooks, result_receiver))\n    }\n\n    /// Preserve in-flight background hooks while applying a refreshed configuration.\n    pub fn reconfigured(&self, config: HooksConfig) -> Self {\n        Self::from_config(\n            config,\n            Arc::clone(&self.engine.mcp_executor),\n            Arc::clone(&self.environment),\n            |shell| self.engine.command_runtime.reconfigured(shell),\n        )\n    }\n\n    pub fn with_executor_hooks(&self, executor_hooks: Vec<ExecutorPluginHookSource>) -> Self {","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/hooks/src/registry.rs#L63-L99","documentation":"Error \"failed to load required managed hooks: {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/hooks/src/registry.rs:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}