mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
## Why A required hook check can fail to run or return a usable result. Continuing after that failure can let an action proceed without a completed check. ## What changed Add per-handler `onFailure` for command and MCP tool hooks. The default `continue` preserves existing behavior. On supported synchronous hooks, `block` applies the event's blocking behavior and reports the reason while preserving failure diagnostics. For example, a failed `PreToolUse` check prevents the tool from running, while a failed `PostToolUse` check withholds the result of a tool that already ran. Expose the policy in the app-server's `configRequirements/read` response. ## Testing Add tests for command and MCP failures under both policies, and scenario coverage for blocked tool execution, withheld results, and completion after a `Stop` hook recovers. GitOrigin-RevId: 20d6ebda0094382fe052bbf34338edb994cc7bd3
codex-protocol
This crate defines the "types" for the protocol used by Codex CLI, which includes both "internal types" for communication between codex-core and codex-tui, as well as "external types" used with codex app-server.
This crate should have minimal dependencies.
Ideally, we should avoid "material business logic" in this crate, as we can always introduce Ext-style traits to add functionality to types in other crates.