-
Notifications
You must be signed in to change notification settings - Fork 1
Add Qwen Code CLI support #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #11
Implements support for Qwen Code CLI (Alibaba's AI coding agent optimized for Qwen3-Coder models) as a new tool option in agent-commander. Key features: - Stream JSON format with --output-format stream-json for real-time NDJSON streaming - Auto-approval mode with --yolo flag (enabled by default for autonomous execution) - Session management with --resume and --continue options - Context options: --all-files and --include-directories - Partial messages support with --include-partial-messages - Model aliases: qwen3-coder, coder, gpt-4o Files changed: - js/src/tools/qwen.mjs: New tool configuration - js/src/tools/index.mjs: Tool registry update - js/test/tools.test.mjs: 23 new tests for Qwen tool - README.md: Documentation and examples - js/.changeset/add-qwen-coder-support.md: Changeset for release Fixes #11 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
This reverts commit da78cc5.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
We should also check if link-assistant/hive-mind#556 has any useful ideas for that implementation. Double check we do unit test everything we, can and it is executed in CI/CD. Also please add support for manual e2e tests (meaning it should be separate manually executed CI workflow) using free plan of Qwen Code CLI. |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-10T16:32:03.619Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
- Add .github/workflows/e2e-qwen.yml for manual E2E testing - Supports workflow_dispatch for manual trigger - Tests Qwen Code CLI installation and configuration - Tests agent-commander integration in dry-run mode - Provides clear instructions for authenticated testing - Add js/experiments/test-qwen-integration.mjs - Comprehensive test script for Qwen tool configuration - Tests model mapping, argument building, output parsing - Tests session ID extraction, usage extraction, error detection - Can be run locally without authentication 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Work Session CompleteBased on the feedback from @konard, I've made the following updates: 1. Reviewed hive-mind PR #556I studied the implementation in link-assistant/hive-mind#556 for useful ideas. The implementation here follows similar patterns with:
2. Verified Unit TestsAll 118 unit tests pass and are executed in CI/CD:
3. Added Manual E2E Testing SupportNew workflow:
New experiment script:
How to Run Manual E2E Tests
CI Status✅ All CI checks passing for the latest commit (70e5641) |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
Both JavaScript and Rust versions must be implemented, have all the same tess. Make sure all our tests in Rust are in separate files, not mixed with code, like we do in JavaScript. Also ensure all changes are correct, consistent and fully meet original requirements. |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-15T14:19:53.093Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
- Add rust/src/tools/qwen.rs with complete Qwen tool implementation - Model mapping with qwen3-coder, coder, gpt-4o, gpt-4, sonnet, opus aliases - Build args for all Qwen Code options (--yolo, --resume, --continue, etc.) - NDJSON output parsing, session ID extraction, usage stats, error detection - QwenTool struct with capability flags matching JS implementation - Update rust/src/tools/mod.rs to register Qwen tool - Add qwen module and exports - Implement Tool trait for QwenTool - Update ToolRegistry, get_tool, list_tools, is_tool_supported - Move all tool tests to separate test files (per feedback): - rust/tests/qwen_tests.rs (24 tests) - rust/tests/claude_tests.rs (17 tests) - rust/tests/codex_tests.rs (12 tests) - rust/tests/opencode_tests.rs (10 tests) - rust/tests/agent_tests.rs (14 tests) - rust/tests/tools_tests.rs (11 tests) Test results: - Rust: 60 unit tests + 88 integration tests = 148 total (all passing) - JavaScript: 118 tests (all passing) Both JS and Rust implementations are consistent with: - Same model mappings - Same capability flags - Same default values - Same function signatures and behavior Co-Authored-By: Claude Opus 4.5 <[email protected]>
Apply automatic formatting via cargo fmt to: - rust/src/tools/qwen.rs: Align comment indentation - rust/tests/agent_tests.rs: Multi-line assert formatting - rust/tests/claude_tests.rs: Multi-line assert formatting - rust/tests/opencode_tests.rs: Multi-line assert formatting Co-Authored-By: Claude Opus 4.5 <[email protected]>
Replace manual Default impl for QwenErrorResult with #[derive(Default)] as suggested by clippy. This is equivalent since all fields have default values (bool defaults to false, Option defaults to None). Co-Authored-By: Claude Opus 4.5 <[email protected]>
- tests/claude_tests.rs: Remove unnecessary reference in comparison - tests/qwen_tests.rs: Replace collect+is_empty with any() for cleaner code Both fixes address clippy warnings that are treated as errors with -Dwarnings. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
|
🤖 AI Work Session Started Starting automated work session at 2026-01-17T23:08:03.655Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
…ntations Both Qwen Code CLI and Gemini CLI are now supported: - JavaScript: qwen.mjs and gemini.mjs tools - Rust: qwen.rs and gemini.rs modules - Updated tool registries to include both tools - Test files updated to include both tools Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Added geminiTool to imports - Combined Qwen and Gemini tests properly - All 140 JavaScript tests now pass Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
✅ Work Session CompleteAll requirements from the feedback have been addressed: 1. Both JavaScript and Rust Versions Implemented ✅
2. Rust Tests in Separate Files ✅
3. Changes Are Correct and Consistent ✅
4. CI/CD Status ✅
Implementation SummaryFiles Changed:
Test Coverage:
The PR is now ready for review! 🤖 Generated with Claude Code |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
This PR implements support for Qwen Code CLI (Alibaba's AI coding agent optimized for Qwen3-Coder models) as a new tool option in agent-commander, similar to how Claude Code CLI, Codex CLI, OpenCode CLI, Gemini CLI, and @link-assistant/agent are implemented.
Key Changes
JavaScript Implementation (
js/src/tools/qwen.mjs)--yoloflag (enabled by default)--resumeand--continueoptions--all-filesand--include-directories--include-partial-messagesqwen3-coder,coder,gpt-4o,gpt-4,sonnet,opusRust Implementation (
rust/src/tools/qwen.rs)rust/tests/qwen_tests.rs(24 tests)Tool Registry Updates
js/src/tools/index.mjsrust/src/tools/mod.rsUnit Testing
Manual E2E Testing (
.github/workflows/e2e-qwen.yml)Experiment Script (
js/experiments/test-qwen-integration.mjs)Changeset
Test Results
✅ All tests pass:
Test Plan
npm test- all 140 JavaScript tests passcargo test- all 197 Rust tests passcargo fmt --check- no formatting issuescargo clippy- no warnings or errorsHow to Run Manual E2E Tests
For authenticated local testing:
npm install -g @qwen-code/qwen-code@latest qwen # then run /auth to authenticate node experiments/test-qwen-integration.mjs --liveFixes #11
🤖 Generated with Claude Code