fix(local-agent): handle empty-string hook_event_name from STDIN#178
Merged
jeff-r2026 merged 1 commit intoJul 10, 2026
Merged
Conversation
…STDIN WorkBuddy/CodeBuddy pass hook_event_name: "" in hook STDIN JSON. The hookDispatchCli already knows the correct event from the CLI argument, so normalize empty/missing hook_event_name before dispatching. Without this, parseHookEvent returns null and binding prompts (ensureWorkspace Binding, emitBindingHint) never trigger. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5dbc3c3 to
55c3874
Compare
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
??=with falsy check forhookData.hook_event_name, so empty strings from STDIN are correctly overwritten with the CLI-derived event nameRoot Cause
WorkBuddy/CodeBuddy pass
hook_event_name: ""in the hook STDIN JSON payload. The??=operator only overwritesnull/undefined, not empty string"". So the empty value was kept,parseHookEventreturnednull(mapEventType("")→null), andcontext.eventstayedundefined— causingensureWorkspaceBinding(session_start) andemitBindingHint(prompt_submit) to be skipped.Fix
1 line change. Empty string is now treated the same as missing — the event name derived from the CLI argument (
session-start→SessionStart, etc.) takes over.Test plan
debug.logshould show[xxxxxx] [workbuddy]tags (local-agent path) instead of[status-report]tagsnpx tsc --noEmitpasses🤖 Generated with Claude Code