From 0403c4dd50ee6d0db2c3ec70b2be6655f9cb65a9 Mon Sep 17 00:00:00 2001 From: Max Felker II Date: Fri, 19 Jun 2026 01:50:55 -0700 Subject: [PATCH] Fix for #168: Don't write output on SessionStart for Copilot (#181) * Added isCopilot flag from runtime and check that in the hooks * When going into off mode, check if codex or copilot --- hooks/ponytail-activate.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hooks/ponytail-activate.js b/hooks/ponytail-activate.js index fb9ad96..059d219 100644 --- a/hooks/ponytail-activate.js +++ b/hooks/ponytail-activate.js @@ -13,6 +13,7 @@ const { getPonytailInstructions } = require('./ponytail-instructions'); const { clearMode, isCodex, + isCopilot, setMode, writeHookOutput, } = require('./ponytail-runtime'); @@ -25,7 +26,8 @@ const mode = getDefaultMode(); // "off" mode — skip activation entirely, don't write flag or emit rules if (mode === 'off') { clearMode(); - writeHookOutput('SessionStart', 'off', isCodex ? '' : 'OK'); + const hookOutput = (isCodex || isCopilot) ? '' : 'OK'; + writeHookOutput('SessionStart', 'off', hookOutput); process.exit(0); } @@ -40,7 +42,7 @@ try { let output = getPonytailInstructions(mode); // 3. Detect missing statusline config — nudge Claude to help set it up -if (!isCodex) try { +if (!isCodex && !isCopilot) try { let hasStatusline = false; if (fs.existsSync(settingsPath)) { // Strip UTF-8 BOM some editors prepend on Windows (breaks JSON.parse)