feat(qwen): add Qwen Code CLI hook support (#1222)#1230
Open
ousamabenyounes wants to merge 2 commits intortk-ai:developfrom
Open
feat(qwen): add Qwen Code CLI hook support (#1222)#1230ousamabenyounes wants to merge 2 commits intortk-ai:developfrom
ousamabenyounes wants to merge 2 commits intortk-ai:developfrom
Conversation
…t/--pretty Two bugs affected `git log` with custom format flags: 1. RTK added `--no-merges` even for custom `--format`/`--pretty`/`--oneline` requests. Scripting users rely on exact commit selection (e.g. reading the date of a merge commit at HEAD); silently skipping merges causes the wrong commit to appear. 2. `filter_log_output` truncated individual lines at 80 chars when `user_format=true`. This corrupts programmatic output — full 40-char SHAs, ISO date strings, and any line longer than 80 chars were silently cut. Fix: when `has_format_flag=true`, skip `--no-merges` injection and copy output lines verbatim (no per-line truncation). RTK still applies the commit-count cap (-50 default or user's -N) so output stays bounded. Closes rtk-ai#1058 Co-Authored-By: Claude <noreply@anthropic.com>
Qwen Code uses the identical BeforeTool JSON format as Gemini CLI (tool_name/tool_input/command). Add first-class support: - `rtk hook qwen` — BeforeTool hook processor (delegates to run_gemini) - `rtk init -g --qwen` — installs ~/.qwen/hooks/rtk-hook-qwen.sh, patches ~/.qwen/settings.json, and installs QWEN.md - New QWEN_HOOK_FILE and QWEN_DIR constants in constants.rs Generated by Claude Code Vibe coded by ousamabenyounes Co-Authored-By: Claude <noreply@anthropic.com>
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 #1222
rtk hook qwen— BeforeTool hook processor for Qwen Code CLI (delegates to Gemini logic since the JSON format is identical)rtk init -g --qwen— installs~/.qwen/hooks/rtk-hook-qwen.sh, patches~/.qwen/settings.json, and installsQWEN.mdQWEN_HOOK_FILEandQWEN_DIRconstants toconstants.rsQwen Code uses the same
tool_name/tool_input/commandBeforeTool JSON format as Gemini CLI, so the hook processor delegates directly torun_gemini()with no duplication.Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testtest_qwen_format_identical_to_geminiverifies the shared rewrite logic applies to Qwen Code commandsrtk init -g --qwencreates hook script and patches settingsGenerated by Claude Code
Vibe coded by ousamabenyounes