feat: Add Qwen Code CLI as LLM provider#559
Open
f-liva wants to merge 3 commits intoRightNow-AI:mainfrom
Open
Conversation
…tability Add qwen-code as a new subprocess-based LLM provider, mirroring the claude-code driver pattern. Qwen Code CLI (qwen) uses --yolo for non-interactive mode and supports json/stream-json output formats. New files: - drivers/qwen_code.rs: full driver with complete/stream, env filtering Changes: - drivers/mod.rs: register qwen-code provider (defaults, create_driver) - model_catalog.rs: add provider info, 3 models (qwen3-coder, qwen-coder-plus, qwq-32b), aliases, auth detection - claude_code.rs: extract build_args() for testability, fix duplicate --dangerously-skip-permissions flag that was always added regardless of skip_permissions setting Tests: 31 new/updated (18 qwen-code + 13 claude-code) covering build_args with/without permission flags, streaming, model selection, prompt building, JSON parsing, and catalog integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <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
build_args()in both Claude Code and Qwen Code drivers for proper testability of CLI flag construction--dangerously-skip-permissionswas added unconditionally regardless of theskip_permissionssettingCloses #558
Details
New provider:
qwen-codeQwen Code is an AI coding agent CLI similar to Claude Code. It supports non-interactive mode (
--yolo), JSON/stream-JSON output, and free usage via Qwen OAuth (60 req/min, 2,000 req/day).New file:
drivers/qwen_code.rsQwenCodeDriverimplementingLlmDrivertraitdetect()viaqwen --versioncomplete()→qwen -p <prompt> --yolo --output-format jsonstream()→qwen -p <prompt> --yolo --output-format stream-json~/.qwen/3 models registered:
qwen-code/qwen3-coderqwen-code/qwen-coder-plusqwen-code/qwq-32bbuild_args()refactor (both drivers)Extracted CLI argument construction into a testable
build_args()method. Previously, the permission flags (--dangerously-skip-permissionsfor Claude,--yolofor Qwen) were only tested at the struct field level — not whether they actually appeared in the CLI arguments. Now we have explicit tests verifying:skip_permissions=trueskip_permissions=falseBug fix: Claude Code duplicate flag
The Claude Code driver was adding
--dangerously-skip-permissionsunconditionally (hardcoded) plus a second time conditionally based onskip_permissions. Thebuild_args()refactor fixes this — the flag is now only added whenskip_permissions=true.Test plan
🤖 Generated with Claude Code