fix(hooks): include required hookEventName in hookSpecificOutput JSON
outputWithContext() emitted a hookSpecificOutput object without the
required hookEventName field, so Claude Code rejected the hook output
("hookSpecificOutput is missing required field hookEventName") and
dropped the context the SessionStart, UserPromptSubmit, and PostToolUse
hooks tried to inject. Thread the event name through the helper; each
caller now passes its own (SessionStart / UserPromptSubmit / PostToolUse).
Existing emission tests now assert hookEventName per event.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmHCQjJHUyWwxGAVVjNLgp
This commit is contained in:
parent
18b0df9a24
commit
7d53a7325e
8 changed files with 22 additions and 6 deletions
12
CHANGELOG.md
12
CHANGELOG.md
|
|
@ -2,6 +2,18 @@
|
|||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Hooks emitted invalid JSON, so Claude Code dropped their injected
|
||||
context.** `outputWithContext()` wrote a `hookSpecificOutput` object
|
||||
without the required `hookEventName` field; the harness rejected it
|
||||
("hookSpecificOutput is missing required field hookEventName") and
|
||||
discarded the context the SessionStart, UserPromptSubmit, and PostToolUse
|
||||
hooks tried to inject. The helper now takes the event name and every
|
||||
caller passes its own (`SessionStart` / `UserPromptSubmit` / `PostToolUse`).
|
||||
|
||||
## [1.2.0] — 2026-05-01
|
||||
|
||||
Research-paper-driven detector update. Implements operational findings from
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue