Skip to content

fix(hooks): add matcher to UserPromptSubmit to skip no-op invocations#625

Open
pablotdv wants to merge 1 commit into
DietrichGebert:mainfrom
pablotdv:fix/userpromptsubmit-matcher-windows-timeout
Open

fix(hooks): add matcher to UserPromptSubmit to skip no-op invocations#625
pablotdv wants to merge 1 commit into
DietrichGebert:mainfrom
pablotdv:fix/userpromptsubmit-matcher-windows-timeout

Conversation

@pablotdv

Copy link
Copy Markdown

Without a matcher the hook fires on every prompt, spawning a PowerShell process + Node.js startup on Windows even when the prompt has nothing to do with ponytail. On slower machines or under antivirus load this easily exceeds the 5 s timeout and the hook output is silently discarded with:

  UserPromptSubmit hook timed out after 5s — output discarded.

The mode-tracker only acts on prompts containing "ponytail" (/ponytail, @Ponytail, $ponytail, "stop ponytail") or the exact deactivation phrase "normal mode". Adding that as the matcher means the hook is skipped entirely for all other prompts — zero process overhead on the fast path

Without a matcher the hook fires on every prompt, spawning a PowerShell
process + Node.js startup on Windows even when the prompt has nothing to
do with ponytail. On slower machines or under antivirus load this easily
exceeds the 5 s timeout and the hook output is silently discarded.

The mode-tracker only acts on prompts that contain "ponytail" (commands
like /ponytail, @Ponytail, $ponytail, "stop ponytail") or the exact
deactivation phrase "normal mode". Adding that as the matcher means the
hook is skipped entirely for all other prompts.
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.

2 participants