Skip to content

fix: only deactivate ponytail on a standalone stop command#162

Merged
DietrichGebert merged 1 commit into
DietrichGebert:mainfrom
Lakshya77089:fix-deactivation-substring
Jun 18, 2026
Merged

fix: only deactivate ponytail on a standalone stop command#162
DietrichGebert merged 1 commit into
DietrichGebert:mainfrom
Lakshya77089:fix-deactivation-substring

Conversation

@Lakshya77089

Copy link
Copy Markdown
Contributor

Fixes #161.

stop ponytail / normal mode were matched anywhere in the prompt, so ordinary requests like "add a normal mode toggle" turned ponytail off mid-session with no feedback. Repro and details in the issue.

The docs describe these as commands you type, so this matches them only when the whole message is the command — trimmed, case-insensitive, trailing punctuation ignored — via a shared isDeactivationCommand helper so the Claude/Codex hook and the pi extension stay in sync.

  • hooks/ponytail-config.js: add isDeactivationCommand
  • hooks/ponytail-mode-tracker.js, pi-extension/index.js: use it instead of the substring regex
  • tests: a request that merely mentions "normal mode" now stays active; the existing standalone "normal mode" / off tests are unchanged and still pass

node --test tests/*.test.js (51) and node --test pi-extension/test/*.test.js (12) pass, and node scripts/check-rule-copies.js is clean.

The deactivation check matched the phrase anywhere in the prompt, so an
ordinary request like "add a normal mode toggle" silently turned ponytail
off for the rest of the session. Match the whole message instead (trimmed,
case-insensitive, trailing punctuation ignored) through a shared helper used
by both the Claude/Codex hook and the pi extension.

Fixes DietrichGebert#161
@DietrichGebert DietrichGebert merged commit 53fd1e8 into DietrichGebert:main Jun 18, 2026
1 check passed
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.

Ponytail silently turns off when a prompt happens to contain "normal mode"

2 participants