Fix for #168: Don't write output on SessionStart for Copilot#181
Open
maxfelker wants to merge 2 commits into
Open
Fix for #168: Don't write output on SessionStart for Copilot#181maxfelker wants to merge 2 commits into
maxfelker wants to merge 2 commits into
Conversation
rajpratham1
approved these changes
Jun 19, 2026
rajpratham1
left a comment
There was a problem hiding this comment.
Nice improvement! Adding isCopilot alongside the existing isCodex checks keeps the behavior consistent across supported environments. I also like the introduction of the hookOutput variable—it makes the intent a bit clearer and avoids repeating the conditional. Overall, the changes look clean and make the logic easier to follow. LGTM!
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.
tl;dr:
!isCodexwas too broad — Copilot sessions leaked Claude-only content intoadditionalContext, breaking token validation on Windows.What broke
ponytail-activate.jshad two guards that usedisCodexto skip Claude-specific behaviour. Both conditions forgot about Copilot — so Copilot sessions fell through into Claude-only paths.Bug 1 — statusline nudge injected into Copilot context
The statusline nudge appends a raw JSON-like fragment to the hook output:
Copilot's parser received this inside
additionalContext, tried to interpret it as a structured instruction token, and rejected it: "the token is not a valid instructions separator in this version."The statusline is a Claude Code setting (
~/.claude/settings.json). Copilot has no equivalent and should never see this nudge.Bug 2 — off-mode emitted
'OK'to CopilotCodex got
''→ empty JSON output{}. Copilot got'OK'→{ "additionalContext": "OK" }. In off mode nothing should be injected. Same class of bug, same fix.What changed
hooks/ponytail-activate.jsonly — two lines:isCopilotwas already exported fromponytail-runtime.js— it just wasn't imported here.Test
node tests/hooks.test.js— hook compatibility checks passed.on behalf of @maxfelker — ponytail found it, two lines fixed it.