Skip to content

fix(install-hooks): merge instead of clobbering other plugins' hooks (0.14.2)#29

Merged
Shahinyanm merged 1 commit into
mainfrom
fix/install-hooks-merge
Jun 12, 2026
Merged

fix(install-hooks): merge instead of clobbering other plugins' hooks (0.14.2)#29
Shahinyanm merged 1 commit into
mainfrom
fix/install-hooks-merge

Conversation

@Shahinyanm

Copy link
Copy Markdown
Member

Problem

install-hooks replaced the entire hooks block in settings.json — wiping any co-located third-party hooks (token-pilot, context-mode, …). Re-running it on a multi-plugin setup nuked everything else.

Fix

It now merges: for each event it touches, it strips only prior task-journal entries (so re-install is idempotent) and appends its own, leaving foreign hooks and untouched events intact.

Test

install_hooks_merges_and_preserves_third_party_hooks: install over pre-existing other-plugin hooks on UserPromptSubmit + SessionStart → the foreign hooks survive, task-journal's nudge + resume get added, and a second install does not duplicate the nudge.

cargo fmt --all --check clean; cargo clippy --workspace --all-targets clean; cargo test --workspace green.

🤖 Generated with Claude Code

…(0.14.2)

install-hooks replaced the entire `hooks` block in settings.json, wiping any
co-located third-party hooks (token-pilot, context-mode, …). It now merges:
for each event it touches, strips only prior task-journal entries (idempotent)
and appends its own, leaving foreign hooks and untouched events intact. Makes
re-running install-hooks safe on a multi-plugin setup.

Test: install over pre-existing third-party hooks → foreign hooks survive,
task-journal added, re-install does not duplicate. fmt/clippy/test green.
@Shahinyanm Shahinyanm merged commit 52e0c5f into main Jun 12, 2026
7 checks passed
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