Skip to content

fix(uninstall): remove Qoder per-project mode files - #1282

Open
danieldutu wants to merge 1 commit into
DietrichGebert:mainfrom
danieldutu:fix/uninstall-qoder-modes
Open

danieldutu wants to merge 1 commit into
DietrichGebert:mainfrom
danieldutu:fix/uninstall-qoder-modes

Conversation

@danieldutu

Copy link
Copy Markdown

scripts/uninstall.js leaves the Qoder per-project mode file behind.

With Qoder detection on (QODER_SESSION_ID set), the mode tracker writes per-project flags under $QODER_CONFIG_DIR/ponytail-modes/<sha256> (hooks/ponytail-runtime.js:40, project keying at :51-57). scripts/uninstall.js:30 removes ponytail-modes under the Claude, Cursor and CodeBuddy directories only, so the Qoder directory survived every uninstall. A leftover flag starts a reinstall with the project's previous mode instead of the configured default, the same effect #676 fixed for the shared Qoder flag.

Repro (scratch dirs, detection emulated with QODER_SESSION_ID, hook run then uninstall): before uninstall the Qoder dir holds .ponytail-active and ponytail-modes/5be02fc2…b6fd28; after uninstall ponytail-modes/5be02fc2…b6fd28 remained. The control (detection off) left 0 files both before and after this change.

Fix: I added getQoderDir() to the directory list at scripts/uninstall.js:30, so the Qoder ponytail-modes directory is removed like the other three. After the fix the same repro leaves 0 files, and node tests/uninstall.test.js passes with a new assertion that the per-project flag is removed.

Boundaries: Windows not tested. Qoder is not installed here; detection was emulated with QODER_SESSION_ID, and the code path is the same once isQoder is set. The precondition that Qoder hook processes carry CLAUDE_PROJECT_DIR comes from closed #1092's report of a real Qoder hook process; I did not verify it. Open PR #1202 makes this path the default for Qoder via QODER_PROJECT_DIR, so this leak becomes the default case once it merges; this change is independent of #1202 and touches only line 30 and the test, so it also applies alongside #1196 and #1264, which edit other parts of uninstall.js.

Checks: npm test (only the known pandas csv env gap fails), npm test --prefix pi-extension 30 pass, node scripts/check-rule-copies.js and node scripts/check-versions.js pass.

Fixes #1279

With Qoder detection on (QODER_SESSION_ID set), the mode tracker writes
per-project flags under $QODER_CONFIG_DIR/ponytail-modes
(hooks/ponytail-runtime.js:40). scripts/uninstall.js:30 removed
ponytail-modes under the Claude, Cursor and CodeBuddy directories only,
so the Qoder directory survived every uninstall. A leftover flag starts
a reinstall with the project's previous mode instead of the configured
default, the same effect DietrichGebert#676 fixed for the shared Qoder flag.

Repro (scratch dirs, detection emulated with QODER_SESSION_ID):

  before uninstall: qoder/.ponytail-active and
    qoder/ponytail-modes/5be02fc2...b6fd28
  after uninstall: qoder/ponytail-modes/5be02fc2...b6fd28 remained

The fix adds getQoderDir() to the directory list, so the Qoder
ponytail-modes directory is removed like the other three. After the
fix the same repro leaves 0 files.

Not covered: Windows untested; Qoder itself is not installed, detection
was emulated. Open PR DietrichGebert#1202 makes this Qoder path the default via
QODER_PROJECT_DIR, so the leak becomes the default case once it
merges; this change is independent of it and of DietrichGebert#1196, which edits
other parts of uninstall.js.
caioniehues pushed a commit to caioniehues/ponytail that referenced this pull request Nov 18, 2026
)

With Qoder detection on (QODER_SESSION_ID set), the mode tracker writes
per-project flags under $QODER_CONFIG_DIR/ponytail-modes
(hooks/ponytail-runtime.js:40). scripts/uninstall.js:30 removed
ponytail-modes under the Claude, Cursor and CodeBuddy directories only,
so the Qoder directory survived every uninstall. A leftover flag starts
a reinstall with the project's previous mode instead of the configured
default, the same effect DietrichGebert#676 fixed for the shared Qoder flag.

Repro (scratch dirs, detection emulated with QODER_SESSION_ID):

  before uninstall: qoder/.ponytail-active and
    qoder/ponytail-modes/5be02fc2...b6fd28
  after uninstall: qoder/ponytail-modes/5be02fc2...b6fd28 remained

The fix adds getQoderDir() to the directory list, so the Qoder
ponytail-modes directory is removed like the other three. After the
fix the same repro leaves 0 files.

Not covered: Windows untested; Qoder itself is not installed, detection
was emulated. Open PR DietrichGebert#1202 makes this Qoder path the default via
QODER_PROJECT_DIR, so the leak becomes the default case once it
merges; this change is independent of it and of DietrichGebert#1196, which edits
other parts of uninstall.js.

(cherry picked from commit 1b43cab)
caioniehues added a commit to caioniehues/ponytail that referenced this pull request Nov 18, 2026
The fork's per-session levels (ponytail-sessions/ beside each host's flag)
survived an uninstall, so a resumed session after a reinstall came back at
its old level, the leftover DietrichGebert#1282 fixed for
ponytail-modes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant