Skip to content

Feat qwen#89

Open
manthanabc wants to merge 6 commits intomainfrom
qwen
Open

Feat qwen#89
manthanabc wants to merge 6 commits intomainfrom
qwen

Conversation

@manthanabc
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 14, 2026 19:28
@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Feb 14, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ba45bace1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

model: &ModelId,
context: ChatContext,
) -> ResultStream<ChatCompletionMessage, anyhow::Error> {
let request = Request::from(context).model(model.clone());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply Qwen model-id mapping before sending chat requests

This sends the selected model ID straight to Qwen without any provider-specific transformation, even though the same commit introduces QwenTransformer to map internal aliases like coder-model/vision-model to upstream model names. Because QwenProvider does not run through ProviderPipeline (or otherwise apply that transformer), configured aliases are sent unmapped and can produce upstream unknown-model errors during chat requests.

Useful? React with 👍 / 👎.

Comment on lines +283 to +287
let token_response = QwenHttpProvider::poll_for_token(
&self.config,
&ctx.request.device_code,
code_verifier.as_str(),
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Retry Qwen device-token polling until user authorization

Qwen device-flow completion performs only one token request here, so any normal delay while the user opens the verification URL and approves access will surface as an immediate OAuth failure (for example authorization_pending). Other device flows in this codebase use a polling loop with timeout/interval handling, but this path lacks that behavior, making interactive OAuth completion brittle or consistently failing.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the Qwen LLM provider, implementing OAuth device flow authentication with PKCE and OpenAI-compatible API integration.

Changes:

  • Added Qwen provider implementation with OAuth device flow and PKCE support
  • Implemented custom HTTP provider for Qwen's authentication requirements
  • Added model transformer for mapping internal model IDs to Qwen API model names

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/paws_services/src/provider/qwen.rs New Qwen provider implementation with chat and models methods
crates/paws_services/src/provider/mod.rs Added qwen module declaration
crates/paws_services/src/provider/client.rs Integrated QwenProvider into client builder and enum
crates/paws_repo/src/provider.json Added Qwen provider configuration with OAuth device flow settings
crates/paws_infra/src/auth/util.rs Added PKCE code verifier/challenge generation and token parsing with resource_url
crates/paws_infra/src/auth/strategy.rs Added OAuthDeviceQwenStrategy for device flow with PKCE
crates/paws_infra/src/auth/http/qwen.rs New Qwen HTTP provider implementing custom device code flow with PKCE
crates/paws_infra/src/auth/http/mod.rs Exposed qwen module and changed visibility to pub
crates/paws_infra/Cargo.toml Added dependencies for PKCE (rand, sha2, base64)
crates/paws_domain/src/provider.rs Added QWEN provider ID and Qwen response type
crates/paws_domain/src/auth/auth_context.rs Added pkce_verifier field to DeviceCodeRequest
crates/paws_app/src/dto/openai/transformers/qwen.rs New transformer for Qwen model ID mapping

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

code_challenge_method: "S256".to_string(),
};

let client = Self::build_http_client_internal(config)?;
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method build_http_client_internal is a thin wrapper around build_http_client. Consider calling build_http_client(config.custom_headers.as_ref())? directly to reduce indirection.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback
also
crates/paws_infra/src/auth/http/qwen.rs
code_verifier: code_verifier.to_string(),
};

    let client = Self::build_http_client_internal(config)?;

https://github.com/apps/copilot-pull-request-reviewer AI
yesterday

The method build_http_client_internal is a thin wrapper around build_http_client. Consider calling build_http_client(config.custom_headers.as_ref())? directly to reduce indirection.

code_verifier: code_verifier.to_string(),
};

let client = Self::build_http_client_internal(config)?;
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method build_http_client_internal is a thin wrapper around build_http_client. Consider calling build_http_client(config.custom_headers.as_ref())? directly to reduce indirection.

Copilot uses AI. Check for mistakes.
@manthanabc manthanabc force-pushed the main branch 2 times, most recently from a7daadd to 60d6447 Compare February 15, 2026 18:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 15, 2026

@manthanabc I've opened a new pull request, #94, to work on those changes. Once the pull request is ready, I'll request review from you.

manthanabc and others added 2 commits February 15, 2026 18:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan

* Remove build_http_client_internal wrapper to reduce indirection

Co-authored-by: manthanabc <48511543+manthanabc@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: manthanabc <48511543+manthanabc@users.noreply.github.com>
@manthanabc
Copy link
Copy Markdown
Owner Author

Todo: fix broken function calling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants