Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new local LLM provider that shells out to the qwen CLI, integrating it into the provider factory and default configuration so it can be selected via qwen-cli/... model refs.
Changes:
- Introduces
QwenCliProviderthat runsqwenas a subprocess and parses its JSON event output intoLLMResponse. - Wires
qwen-cliinto provider creation (CreateProviderFromConfig) and provider selection logic. - Adds comprehensive unit tests plus a default
model_listentry forqwen-cli/qwen-code.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/providers/qwen_cli_provider.go | Implements the new CLI-backed provider (prompt building, subprocess execution, JSON event parsing). |
| pkg/providers/qwen_cli_provider_test.go | Adds unit tests for Chat(), prompt building, JSON parsing, and factory integration. |
| pkg/providers/factory.go | Adds qwen-cli to provider selection (workspace resolution). |
| pkg/providers/factory_provider.go | Adds qwen-cli protocol support to CreateProviderFromConfig. |
| pkg/config/defaults.go | Adds a default model_list entry for qwen-cli/qwen-code. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pkg/providers/qwen_cli_provider.go
Outdated
| } | ||
| } | ||
| case "error": | ||
| lastError = event.Error.Message |
pkg/providers/qwen_cli_provider.go
Outdated
Comment on lines
+73
to
+80
| if err != nil { | ||
| if ctx.Err() == context.Canceled { | ||
| return nil, ctx.Err() | ||
| } | ||
| if stderrStr := stderr.String(); stderrStr != "" { | ||
| return nil, fmt.Errorf("qwen cli error: %s", stderrStr) | ||
| } | ||
| return nil, fmt.Errorf("qwen cli error: %w", err) |
Collaborator
|
@dome plz resolve conflicts |
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.
Add support for Qwen Code CLI (qwen) as a new LLM provider. This enables users to use the qwen CLI tool as a provider, similar to the existing claude-cli and codex-cli providers.
Changes:
📝 Description
🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
📚 Technical Context (Skip for Docs)
🧪 Test Environment
📸 Evidence (Optional)
Click to view Logs/Screenshots
☑️ Checklist