From 4c965030b7a1a9419b3007de6b77c3b09a20d3e2 Mon Sep 17 00:00:00 2001 From: kyeo Date: Fri, 27 Feb 2026 08:38:10 +0800 Subject: [PATCH] fix: resolve CI linting errors for Qwen OAuth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix gci formatting: remove trailing whitespace on line 230 - Add nolint:gosmopolitan for intentional Chinese UI strings - Remove unused qwenPortalBaseURL constant - Fix spelling: serialises → serializes Co-authored-by: Qwen-Coder --- cmd/picoclaw/internal/auth/helpers.go | 1 + pkg/auth/qwen_oauth.go | 6 ++---- pkg/providers/qwen_provider.go | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/picoclaw/internal/auth/helpers.go b/cmd/picoclaw/internal/auth/helpers.go index 157b9e2d4..eb13b5eea 100644 --- a/cmd/picoclaw/internal/auth/helpers.go +++ b/cmd/picoclaw/internal/auth/helpers.go @@ -499,6 +499,7 @@ func authLoginQwen() error { fmt.Println("\n✓ Qwen OAuth login successful!") fmt.Println("Default model set to: qwen-coder (coder-model)") fmt.Println("Available models: qwen-coder, qwen-vision") + //nolint:gosmopolitan // intentional Chinese character for user-facing message fmt.Println("Try it: picoclaw agent -m \"你好\" --model qwen-coder") return nil diff --git a/pkg/auth/qwen_oauth.go b/pkg/auth/qwen_oauth.go index b23740eb3..f8e763d06 100644 --- a/pkg/auth/qwen_oauth.go +++ b/pkg/auth/qwen_oauth.go @@ -25,9 +25,6 @@ const ( qwenClientID = "f0304373b74a44d2b584a3fb70ca9e56" qwenOAuthScope = "openid profile email model.completion" qwenDeviceGrantType = "urn:ietf:params:oauth:grant-type:device_code" - // Qwen Portal API base URL (OpenAI-compatible endpoint) - // This is the same endpoint used by OpenClaw - qwenPortalBaseURL = "https://portal.qwen.ai/v1" ) // qwenDeviceAuthorization is returned by the device/code endpoint. @@ -176,6 +173,7 @@ func pollQwenToken(deviceCode, verifier string, interval, expiresIn int) (*qwenT // until the token is granted. func LoginQwenQRCode() (*AuthCredential, error) { fmt.Println() + //nolint:gosmopolitan // intentional Chinese characters for user-facing message fmt.Println("=== Qwen (通义千问) OAuth Login ===") fmt.Println() @@ -227,7 +225,7 @@ func LoginQwenQRCode() (*AuthCredential, error) { // 5. Build credential expiresAt := time.Now().Add(time.Duration(tok.ExpiresIn) * time.Second) - + cred := &AuthCredential{ AccessToken: tok.AccessToken, RefreshToken: tok.RefreshToken, diff --git a/pkg/providers/qwen_provider.go b/pkg/providers/qwen_provider.go index 87207b3b6..0bd5637ea 100644 --- a/pkg/providers/qwen_provider.go +++ b/pkg/providers/qwen_provider.go @@ -134,7 +134,7 @@ func (p *QwenOAuthProvider) Chat( return p.parseResponse(body) } -// buildRequestBody serialises the chat request as an OpenAI-compatible JSON body. +// buildRequestBody serializes the chat request as an OpenAI-compatible JSON body. func (p *QwenOAuthProvider) buildRequestBody( messages []Message, tools []ToolDefinition,