Skip to content

Support PermissionRequest hook deny interrupts#17735

Closed
abhinav-oai wants to merge 4 commits intocodex/permission-request-hooks-basefrom
codex/permission-request-hook-interrupt
Closed

Support PermissionRequest hook deny interrupts#17735
abhinav-oai wants to merge 4 commits intocodex/permission-request-hooks-basefrom
codex/permission-request-hook-interrupt

Conversation

@abhinav-oai
Copy link
Copy Markdown
Collaborator

Summary

  • allow PermissionRequest hook handlers to return decision.interrupt: true when denying a request
  • route interrupting denies through the existing interrupted-turn lifecycle so the agent loop stops with TurnAbortReason::Interrupted
  • add end-to-end coverage for an interrupting shell_command denial and update the generated hook schema fixture

Why

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

  • parse and carry interrupt only for deny decisions in the hooks crate
  • map interrupting denies to session.interrupt_task() in the core approval paths
  • treat interrupted in-flight tool futures as normal turn aborts during drain

Validation

  • cargo test -p codex-hooks
  • cargo test -p codex-core --test all permission_request_hook_interrupts_shell_command_turn
  • cargo test -p codex-core

Notes

  • This PR is stacked on codex/permission-request-hooks-base (Add PermissionRequest hooks support #17563).
  • The local cargo test -p codex-core run still reported two unrelated failures in this environment:
    • plugins::manager::tests::list_marketplaces_ignores_installed_roots_missing_from_config
    • tools::js_repl::tests::js_repl_imported_local_files_can_access_repl_globals

abhinav-oai and others added 3 commits April 13, 2026 18:14
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>
@abhinav-oai abhinav-oai changed the title [codex] Support interrupting permission request hook denials Support PermissionRequest hook deny interrupts Apr 14, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant