Skip to content

fix(qoder): persist off mode across prompts - #676

Open
l2yujw wants to merge 1 commit into
DietrichGebert:mainfrom
l2yujw:fix/qoder-off-persistence
Open

fix(qoder): persist off mode across prompts#676
l2yujw wants to merge 1 commit into
DietrichGebert:mainfrom
l2yujw:fix/qoder-off-persistence

Conversation

@l2yujw

@l2yujw l2yujw commented Aug 3, 2026

Copy link
Copy Markdown

Summary

On Qoder, turning Ponytail off only lasted for the current hook invocation. The next ordinary prompt treated the missing state file as first-run initialization and restored the configured default mode.

This change:

  • persists the literal off state on Qoder;
  • applies the same behavior to /ponytail off, stop ponytail, and normal mode;
  • adds a regression test proving that a later ordinary prompt does not reactivate Ponytail.

Root cause

Qoder has no SessionStart, so its UserPromptSubmit path initializes the default mode whenever readMode() returns no state:

if (isQoder && !deactivated) {
  let currentMode = readMode();
  if (!currentMode) {
    currentMode = getDefaultMode();
  }
}

The deactivation paths previously called clearMode(). That made an intentionally disabled Qoder session indistinguishable from a session that had not been initialized yet.

Fix

For Qoder, deactivation now stores off with setMode('off').

Other hosts retain the existing clearMode() behavior, so the change is scoped to Qoder.

Verification

node --test tests/hooks.test.js
npm test
git diff --check

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