Repository navigation
fix(hooks): own Gemini hooks by exact command, not substring - #4235
Open
amandeavor wants to merge 1 commit into
Open
amandeavor wants to merge 1 commit into
amandeavor wants to merge 1 commit into
Conversation
📊 Automated PR Analysis
SummaryFixes RTK's Gemini hook ownership detection, which previously used a substring match on "rtk" and could delete or ignore unrelated user hooks sharing the same BeforeTool group. The PR reuses shared grouped-hook helpers to own hooks only by exact installed path, the rtk-hook-gemini.sh filename, or the literal 'rtk hook gemini' command, and updates uninstall to remove only matching entries while preserving sibling hooks. Review Checklist
Linked issues: #4227 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
5 tasks done
amandeavor
force-pushed
the
fix/gemini-hook-exact-ownership
branch
from
October 23, 2026 15:34
0172595 to
439df31
Compare
Use hook_present/remove_hook_entries with exact command matching so sibling hooks in BeforeTool groups are preserved on uninstall and unrelated paths containing 'rtk' (e.g. /opt/smartkit) do not count as RTK's hook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #4227.
patch_gemini_settingsanduninstall_geminidecided ownership withcommand.contains(\"rtk\")on the first hook in eachBeforeToolgroup. That caused two failures:rtk(e.g./opt/smartkit/check.sh).Changes
rtk-hook-gemini.sh, or isrtk hook geminiTests
test_gemini_hook_ownership_is_exact_and_preserves_siblings— mixed group keeps/opt/audit/log-shell.shtest_gemini_hook_presence_ignores_unrelated_rtk_substring_paths—/opt/smartkit/check.shis not treated as RTK'scargo test --bin rtk -- test_gemini_hook_— green locally