Skip to content

[codex] fix Hookify prompt fields and warning context#67084

Open
nyxst4ck wants to merge 1 commit into
anthropics:mainfrom
nyxst4ck:codex/hookify-prompt-field
Open

[codex] fix Hookify prompt fields and warning context#67084
nyxst4ck wants to merge 1 commit into
anthropics:mainfrom
nyxst4ck:codex/hookify-prompt-field

Conversation

@nyxst4ck

@nyxst4ck nyxst4ck commented Jun 10, 2026

Copy link
Copy Markdown

Summary

  • Map legacy event: prompt + pattern: rules to the current UserPromptSubmit payload field, prompt
  • Keep user_prompt as a backward-compatible alias for existing rules
  • Add hookSpecificOutput.additionalContext to Hookify warning responses for hook events that support context injection, so Claude sees warnings instead of only the user seeing systemMessage

Why

The current hooks reference documents UserPromptSubmit input as prompt, while older Hookify rules and an open PR used user_prompt. This keeps both forms working while making prompt the primary field.

Hookify warn rules also returned only systemMessage, which is visible to the user but does not give Claude context to adjust its behavior. Adding additionalContext fixes the issue reported in #20747 without auto-approving PreToolUse permissions.

Related: #59151
Fixes #20747

Tests

  • python -m unittest plugins.hookify.tests.test_prompt_field_mapping plugins.hookify.tests.test_warning_context
  • python -m compileall -q plugins\hookify
  • git diff --check upstream/main...HEAD

@nyxst4ck nyxst4ck force-pushed the codex/hookify-prompt-field branch from 0b50bcb to 7dabee3 Compare June 10, 2026 16:18
@nyxst4ck nyxst4ck changed the title [codex] fix Hookify prompt field handling [codex] fix Hookify prompt fields and warning context Jun 10, 2026
@nyxst4ck nyxst4ck marked this pull request as ready for review June 10, 2026 17:22
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.

Hookify warnings don't reach the model (only shown to user)

1 participant