Repository navigation
fix(grok): prefix PowerShell call operator on Windows hook commands - #750
Open
Dannym-Packetloss wants to merge 1 commit into
Open
Dannym-Packetloss wants to merge 1 commit into
Dannym-Packetloss wants to merge 1 commit into
Conversation
Grok runs hook commands through pwsh on Windows. A command that starts with a quoted path is a string expression there, so every generated hook exited 1 with a ParserError and never reached the hive. Fixes HarnessMD#749 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
✅ Evidence received. Before and after are both attached. Thanks — this is what makes a PR reviewable in one pass. |
This branch has not been deployed
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
Grok runs hook commands through PowerShell (pwsh) on Windows.
installGrokHooks()wrote"<hive-node.cmd>" "<grok-hook.cjs>"; in PowerShell a line that starts with a quoted string is an expression, so the second string is a ParserError (Unexpected token) and every hook exits 1. Grok ignores the failure, so tools run but the hive never gets status, session capture or tracking. Because the file is rewritten on every Grok spawn, a manual fix does not survive.This adds
grokHookCommand(), which puts PowerShell's call operator in front on win32:& "<hive-node.cmd>" "<grok-hook.cjs>". macOS/Linux output is unchanged.Fixes #749
Tests
grokHookCommand()per platform.npm run typecheckclean;test/hive-hook-node.test.cjs: 11 pass, 0 fail, 3 skipped (POSIX only).npm run test:focusedadds 2 passing tests and no new failures.Before
The generated hook command, run by pwsh 7.6.6 as Grok runs it:
After
With this command in
~/.grok/hooks/munder-hive.json, Grok's Hooks tab showsglobal/munder-hivepassing (pre_tool_use,post_tool_use,user_prompt_submit: status=success) where it previously failed every event.🤖 Generated with Claude Code