fix: only deactivate on a standalone "stop ponytail" / "normal mode" (#162)
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 #161
This commit is contained in:
@@ -7,6 +7,7 @@ const {
|
||||
normalizeMode,
|
||||
normalizeConfigMode,
|
||||
normalizePersistedMode,
|
||||
isDeactivationCommand,
|
||||
writeDefaultMode,
|
||||
} = require("../hooks/ponytail-config.js");
|
||||
const { getPonytailInstructions, filterSkillBodyForMode } = require("../hooks/ponytail-instructions.js");
|
||||
@@ -133,7 +134,7 @@ export default function ponytailExtension(pi) {
|
||||
if (event?.source === "extension") return;
|
||||
|
||||
const text = String(event?.text || "");
|
||||
if (currentMode !== "off" && /\b(stop ponytail|normal mode)\b/i.test(text)) {
|
||||
if (currentMode !== "off" && isDeactivationCommand(text)) {
|
||||
setMode("off");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user