Skip to content

fix(opencode,hermes): honor "stop ponytail" and keep review out of the OpenCode flag - #901

Closed
ishank-ninja wants to merge 1 commit into
DietrichGebert:mainfrom
ishank-ninja:fix/deactivate-opencode-hermes
Closed

ishank-ninja wants to merge 1 commit into
DietrichGebert:mainfrom
ishank-ninja:fix/deactivate-opencode-hermes

Conversation

@ishank-ninja

Copy link
Copy Markdown

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:

Fix

  • Hermes: _pre_llm_call reads user_message. A standalone "stop ponytail" / "normal mode" sets the mode to off, exactly like /ponytail off. That means the whole message, case-insensitive, trailing punctuation ignored, the same rule as isDeactivationCommand. State stays process-wide as today, with a ponytail: comment naming that ceiling.
  • OpenCode:
    • A new chat.message handler (V1 plugin API, packages/plugin/src/index.ts) reuses isDeactivationCommand on the user's non-synthetic text parts and persists off.
    • /ponytail and readMode accept only runtime levels (normalizeMode). review is never persisted, and an existing stale review flag falls back to the default.

Tests

  • tests/opencode-plugin.test.js:
    • /ponytail review doesn't overwrite the flag;
    • a stale review flag injects the full ruleset;
    • chat.message turns ponytail off on "Stop ponytail!" (with a synthetic attachment part present), but not on "add a normal mode toggle…".
  • tests/hermes-plugin.test.js:
    • a mention keeps injecting;
    • "Stop Ponytail!" returns no context on that turn and the next;
    • /ponytail lite re-enables it.
  • The new tests fail on main. npm test passes.

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.message deactivation and the runtime-only persistence forward. #787 also edits Hermes _pre_llm_call (a small textual conflict).

🤖 Generated with Claude Code

…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>
@ishank-ninja

Copy link
Copy Markdown
Author

Closing because these were opened due to a task-scope misunderstanding.

@ishank-ninja
ishank-ninja deleted the fix/deactivate-opencode-hermes branch September 19, 2026 21:06
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.

1 participant