Repository navigation
Commit a1afa12
Let required hooks block continuation on failure (#62831)
## 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: 20d6ebda0094382fe052bbf34338edb994cc7bd31 parent 0a0b102 commit a1afa12
49 files changed
Lines changed: 1377 additions & 52 deletions
File tree
- codex-rs
- app-server-protocol
- schema
- json
- v2
- precomputed
- typescript/v2
- src/protocol/v2
- app-server
- src/request_processors
- tests/suite/v2
- config/src
- core-plugins/src
- core
- src
- session
- tests/suite
- snapshots
- hooks/src
- engine
- events
- protocol/src
- tui/src
- chatwidget
- snapshots
- tests
- sdk/python/src/openai_codex/generated
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
741 | 749 | | |
742 | 750 | | |
743 | 751 | | |
| |||
756 | 764 | | |
757 | 765 | | |
758 | 766 | | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
759 | 770 | | |
760 | 771 | | |
761 | 772 | | |
| |||
776 | 787 | | |
777 | 788 | | |
778 | 789 | | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
779 | 793 | | |
780 | 794 | | |
781 | 795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
865 | 866 | | |
866 | 867 | | |
867 | 868 | | |
| 869 | + | |
868 | 870 | | |
869 | 871 | | |
870 | 872 | | |
871 | 873 | | |
872 | 874 | | |
873 | 875 | | |
874 | 876 | | |
| 877 | + | |
875 | 878 | | |
876 | 879 | | |
877 | 880 | | |
| |||
880 | 883 | | |
881 | 884 | | |
882 | 885 | | |
| 886 | + | |
883 | 887 | | |
884 | 888 | | |
885 | 889 | | |
886 | 890 | | |
887 | 891 | | |
888 | 892 | | |
| 893 | + | |
889 | 894 | | |
890 | 895 | | |
891 | 896 | | |
892 | 897 | | |
893 | 898 | | |
894 | 899 | | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
895 | 909 | | |
896 | 910 | | |
897 | 911 | | |
| |||
0 commit comments