Repository navigation
fix(hooks): recognize rtk hook commands that carry rtk flags - #4265
Open
mrhard9090 wants to merge 1 commit into
Open
mrhard9090 wants to merge 1 commit into
mrhard9090 wants to merge 1 commit into
Conversation
A hook registered as `rtk hook claude --ultra-compact --skip-env` or `rtk --ultra-compact hook claude` was reported as not installed because detection required exactly three words. Skip the flags that leave the hook unchanged and match the rest. Fixes rtk-ai#4211
📊 Automated PR Analysis
SummaryFixes rtk's hook-detection logic so that Review Checklist
Linked issues: #4211 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
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
Fixes #4211
is_rtk_hook_commandaccepted a hook only when it split into exactlyrtk hook <agent>. A registration that uses the documented flags, such asrtk hook claude --ultra-compact --skip-envorrtk --ultra-compact hook claude, was reported as missing:rtk verifyprintedSKIP RTK hook not installedand theNo hook installedbanner kept coming back, although the hook runs.arg_tokenizer::tokenize.--ultra-compact,--skip-env,--verboseand-vclusters are skipped. What remains must be exactlyhook <agent>. Any other flag, an attached value,--or an extra argument still fails the match.rtk init(which no longer adds a second hook next to a flagged one), uninstall (which now removes a flagged hook) and the codex/trae checks.matcherand hooktype. That is a separate fix.Test plan
claude_hook_command_accepts_rtk_flags.claude_hook_command_rejects_other_commandsgains an unknown flag, an extra argument, an attached value,--and a missing agent.rtk verifywithCLAUDE_CONFIG_DIRpointing to a settings.json from the issue's probe.rtk hook claude,rtk hook claude --ultra-compact --skip-envandrtk --ultra-compact hook claudereportPASS native binary hook registered.rtk hook claude --bogusstill reportsSKIP RTK hook not installed.cargo fmt --all && cargo clippy --all-targets(clean)&& cargo teston Windows (MSVC): 3742 passed, 2 failed.find_cmd::run_from_args_propagates_find_exit_statusandstream::test_read_lines_lossy_preserves_lines_after_invalid_utf8fail the same way ondevelopon this machine.Written with help from Claude Opus 5.5.