fix(opencode,hermes): honor "stop ponytail" and keep review out of the OpenCode flag - #901
Closed
ishank-ninja wants to merge 1 commit into
Closed
ishank-ninja wants to merge 1 commit into
ishank-ninja wants to merge 1 commit into
Conversation
…e OpenCode flag The injected ruleset says ponytail turns off with "stop ponytail" / "normal mode". The Claude/Codex hooks and pi honor that via isDeactivationCommand; two hosts didn't: - Hermes: _pre_llm_call ignored user_message, so "stop ponytail" kept injecting "ACTIVE EVERY RESPONSE" on that turn and every later one. It now switches off the same way /ponytail off does (state stays process-wide, marked with a ponytail: comment). - OpenCode: no hook looked at chat messages. Add a chat.message handler (V1 plugin API) that reuses isDeactivationCommand on the user's non-synthetic text and persists off. Separately, OpenCode's `/ponytail review` went through normalizePersistedMode and was written to the long-lived flag, so every later session injected only the one-line review stub instead of the ruleset. /ponytail and readMode now accept runtime levels only (DietrichGebert#377), so a stale review flag also falls back to the default. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Author
|
Closing because these were opened due to a task-scope misunderstanding. |
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.
Problem
The injected ruleset tells the model that ponytail turns off with "stop ponytail" / "normal mode". The Claude/Codex hooks and pi honor that via
isDeactivationCommand, but two hosts don't:_pre_llm_callignoresuser_message.pre_llm_call(user_message='stop ponytail')returns the full "ACTIVE EVERY RESPONSE" ruleset, and so does every later turn..opencode/plugins/ponytail.mjs): no hook looks at chat messages, so "stop ponytail" does nothing. Separately,/ponytail reviewgoes throughnormalizePersistedModeand is written to the long-lived.ponytail-active. Every later session then injects only the one-linelevel: reviewstub instead of the ruleset. This is the same class of bug as /ponytail-review latches the session mode flag, replacing the ruleset with a pointer line for the rest of the session #736; review is session-only per hooks/ponytail-config.js: 'review' in VALID_MODES but not RUNTIME_MODES — config accepts it but silently falls back to 'full' #377.Fix
_pre_llm_callreadsuser_message. A standalone "stop ponytail" / "normal mode" sets the mode tooff, exactly like/ponytail off. That means the whole message, case-insensitive, trailing punctuation ignored, the same rule asisDeactivationCommand. State stays process-wide as today, with aponytail:comment naming that ceiling.chat.messagehandler (V1 plugin API,packages/plugin/src/index.ts) reusesisDeactivationCommandon the user's non-synthetic text parts and persistsoff./ponytailandreadModeaccept only runtime levels (normalizeMode).reviewis never persisted, and an existing stalereviewflag falls back to the default.Tests
tests/opencode-plugin.test.js:/ponytail reviewdoesn't overwrite the flag;reviewflag injects the full ruleset;chat.messageturns ponytail off on "Stop ponytail!" (with a synthetic attachment part present), but not on "add a normal mode toggle…".tests/hermes-plugin.test.js:/ponytail litere-enables it.npm testpasses.The OpenCode diff is kept minimal so it rebases cleanly onto the V2 rewrites in #864, #729 and #734. Whichever of those lands should carry the
chat.messagedeactivation and the runtime-only persistence forward. #787 also edits Hermes_pre_llm_call(a small textual conflict).🤖 Generated with Claude Code