fix(init): detect and clean up orphaned .github/hooks/rtk-rewrite.json with broken hook command#837
Open
rolf-quadra wants to merge 1 commit intortk-ai:developfrom
Open
Conversation
ef08df0 to
b712f13
Compare
Contributor
|
Hey We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes No logic changes — only file moves and import path updates. What you need to doRebase your branch on git fetch origin && git rebase origin/developGit detects renames automatically. If you get import conflicts, update the paths: use crate::git; // now: use crate::cmds::git::git;
use crate::tracking; // now: use crate::core::tracking;
use crate::config; // now: use crate::core::config;
use crate::init; // now: use crate::hooks::init;
use crate::gain; // now: use crate::analytics::gain;Need help rebasing? Tag @aeppling |
Users who ran an earlier rtk init --copilot (from commit rtk-ai#605) ended up with .github/hooks/rtk-rewrite.json containing "command": "rtk hook" (missing subcommand). This causes RTK to log a spurious parse_failure on every Bash tool call, inflating rtk gain --failures stats silently. - rtk init --show: warns when the broken file is detected, with actionable guidance pointing to rtk gain --failures and the fix - rtk init -g --uninstall: removes the broken file as part of standard cleanup (only when command is the broken "rtk hook", leaves a correctly configured "rtk hook copilot" file untouched) Fixes rtk-ai#836
b712f13 to
3f9e822
Compare
Author
|
Refactored to comply with the repository reorg. |
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.
Fixes #836
What
rtk init --show: warns when.github/hooks/rtk-rewrite.jsonexists with"command": "rtk hook"(missing subcommand), with actionable guidance pointing tortk gain --failuresand the fixrtk init -g --uninstall: removes the broken file as part of standard cleanup (only when the command is the broken"rtk hook"— a correctly configured"rtk hook copilot"file is left untouched)Why
Users who ran an earlier
rtk init --copilot(introduced in #605) got.github/hooks/rtk-rewrite.jsonwith"command": "rtk hook"(no subcommand). Sincertk hookrequiresgeminiorcopilot, it prints help and exits non-zero on every Bash tool call. RTK silently logs aparse_failurewithraw_command = "hook"andfallback_succeeded = 0inhistory.db, inflatingrtk gain --failuresstats with no visible error to the user.The pending Copilot integration (#823) correctly generates
"rtk hook copilot", but neitherrtk init --shownorrtk init --uninstallcheck.github/hooks/for these orphaned files.Changes
src/init.rsonly — 66 lines added, no deletions, no new dependencies.Test