Support PermissionRequest hook deny interrupts#17735
Closed
abhinav-oai wants to merge 4 commits intocodex/permission-request-hooks-basefrom
Closed
Support PermissionRequest hook deny interrupts#17735abhinav-oai wants to merge 4 commits intocodex/permission-request-hooks-basefrom
abhinav-oai wants to merge 4 commits intocodex/permission-request-hooks-basefrom
Conversation
Allow PermissionRequest hooks to return interrupt=true on deny and route that through the existing interrupted turn lifecycle. Co-authored-by: Codex <noreply@openai.com>
Keep aborting turns installed until cleanup finishes and surface interrupting network approval denials as interrupted outcomes. Co-authored-by: Codex <noreply@openai.com>
Add terse comments around aborting-turn ownership and event ordering. Co-authored-by: Codex <noreply@openai.com>
Restore pending-state cleanup after task abort finalization and clear aborting turns even when no tasks were drained. Co-authored-by: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PermissionRequesthook handlers to returndecision.interrupt: truewhen denying a requestTurnAbortReason::Interruptedshell_commanddenial and update the generated hook schema fixtureWhy
This extends the permission-request hook contract so a deny can optionally behave like an Esc interrupt instead of only surfacing as a normal approval rejection.
Implementation
interruptonly for deny decisions in the hooks cratesession.interrupt_task()in the core approval pathsValidation
cargo test -p codex-hookscargo test -p codex-core --test all permission_request_hook_interrupts_shell_command_turncargo test -p codex-coreNotes
codex/permission-request-hooks-base(Add PermissionRequest hooks support #17563).cargo test -p codex-corerun still reported two unrelated failures in this environment:plugins::manager::tests::list_marketplaces_ignores_installed_roots_missing_from_configtools::js_repl::tests::js_repl_imported_local_files_can_access_repl_globals