Skip to content

fix: emit per-turn reminder in UserPromptSubmit to prevent drift after compaction#77

Open
vanceingalls wants to merge 2 commits into
DietrichGebert:mainfrom
vanceingalls:fix/userpromptsubmit-per-turn-reminder
Open

fix: emit per-turn reminder in UserPromptSubmit to prevent drift after compaction#77
vanceingalls wants to merge 2 commits into
DietrichGebert:mainfrom
vanceingalls:fix/userpromptsubmit-per-turn-reminder

Conversation

@vanceingalls

Copy link
Copy Markdown

Problem

SessionStart injects the full ponytail ruleset once. When the context window fills and compacts, that injection disappears. The UserPromptSubmit hook only fires context on /ponytail commands — silent the rest of the time. Result: model drifts back to over-building mid-session with no reminder.

Fix

ponytail-mode-tracker.js now emits a brief PONYTAIL MODE ACTIVE — level: {mode} reminder on every turn (when active), matching the pattern already used by tools like Caveman. This keeps the active mode in context across compaction boundaries.

Changes:

  • hooks/ponytail-runtime.js: export getMode() — reads current mode from the flag file
  • hooks/ponytail-mode-tracker.js: import getMode(), add early return on mode-change paths, emit per-turn reminder at the end of the normal (non-command) path

The reminder is one line, zero overhead when ponytail is off.

@vanceingalls vanceingalls marked this pull request as draft June 15, 2026 19:01
@vanceingalls vanceingalls marked this pull request as ready for review June 15, 2026 19:07
@vanceingalls vanceingalls force-pushed the fix/userpromptsubmit-per-turn-reminder branch from 21c9e66 to 36f9c4d Compare June 15, 2026 19:08

@anupddas anupddas left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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.

2 participants