From 6142fbf64a87bde3c32165e3354de78f50cf2f24 Mon Sep 17 00:00:00 2001 From: tanzhenxin Date: Fri, 22 Aug 2025 15:17:42 +0800 Subject: [PATCH 1/4] fix: invalid web search tool schema when using deepseek api --- packages/core/src/tools/web-search.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/core/src/tools/web-search.ts b/packages/core/src/tools/web-search.ts index adeda1a7..eacb4143 100644 --- a/packages/core/src/tools/web-search.ts +++ b/packages/core/src/tools/web-search.ts @@ -5,7 +5,6 @@ */ import { BaseTool, Icon, ToolResult } from './tools.js'; -import { Type } from '@google/genai'; import { SchemaValidator } from '../utils/schemaValidator.js'; import { getErrorMessage } from '../utils/errors.js'; import { Config } from '../config/config.js'; @@ -57,10 +56,10 @@ export class WebSearchTool extends BaseTool< 'Performs a web search using the Tavily API and returns a concise answer with sources. Requires the TAVILY_API_KEY environment variable.', Icon.Globe, { - type: Type.OBJECT, + type: 'object', properties: { query: { - type: Type.STRING, + type: 'string', description: 'The search query to find information on the web.', }, }, From a6ce22773bbd782adf834284b152089d5527c6a6 Mon Sep 17 00:00:00 2001 From: tanzhenxin Date: Fri, 22 Aug 2025 15:21:55 +0800 Subject: [PATCH 2/4] feat: add specific header for dashscope provider --- packages/core/src/core/openaiContentGenerator.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/src/core/openaiContentGenerator.ts b/packages/core/src/core/openaiContentGenerator.ts index 3f223f3e..8f05f2e0 100644 --- a/packages/core/src/core/openaiContentGenerator.ts +++ b/packages/core/src/core/openaiContentGenerator.ts @@ -129,6 +129,7 @@ export class OpenAIContentGenerator implements ContentGenerator { : isDashScopeProvider ? { 'X-DashScope-CacheControl': 'enable', + 'X-DashScope-UserAgent': userAgent, } : {}), }; From aebb69925c92e1f44f71ad7d85ba3196ff680c8f Mon Sep 17 00:00:00 2001 From: tanzhenxin Date: Fri, 22 Aug 2025 16:15:32 +0800 Subject: [PATCH 3/4] fix: invalid tool call with IDE companion feature enabled --- packages/core/src/core/client.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/core/src/core/client.ts b/packages/core/src/core/client.ts index 876e9027..e1da0471 100644 --- a/packages/core/src/core/client.ts +++ b/packages/core/src/core/client.ts @@ -485,7 +485,24 @@ export class GeminiClient { } } - if (this.config.getIdeModeFeature() && this.config.getIdeMode()) { + // Prevent context updates from being sent while a tool call is + // waiting for a response. The Qwen API requires that a functionResponse + // part from the user immediately follows a functionCall part from the model + // in the conversation history . The IDE context is not discarded; it will + // be included in the next regular message sent to the model. + const history = this.getHistory(); + const lastMessage = + history.length > 0 ? history[history.length - 1] : undefined; + const hasPendingToolCall = + !!lastMessage && + lastMessage.role === 'model' && + (lastMessage.parts?.some((p) => 'functionCall' in p) || false); + + if ( + this.config.getIdeModeFeature() && + this.config.getIdeMode() && + !hasPendingToolCall + ) { const { contextParts, newIdeContext } = this.getIdeContextParts( this.forceFullIdeContext || this.getHistory().length === 0, ); From d6c2e8cc317c1d23be08bbcecaf9577b32d09c24 Mon Sep 17 00:00:00 2001 From: tanzhenxin Date: Fri, 22 Aug 2025 17:11:37 +0800 Subject: [PATCH 4/4] chore: pump version to 0.0.8 (#421) * chore: pump version to 0.0.8 --- CHANGELOG.md | 43 ++++++++++++++-------- docs/deployment.md | 2 +- package-lock.json | 12 +++--- package.json | 4 +- packages/cli/package.json | 4 +- packages/core/package.json | 2 +- packages/test-utils/package.json | 2 +- packages/vscode-ide-companion/package.json | 2 +- 8 files changed, 41 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef339f20..b0b33eda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,26 +1,37 @@ # Changelog +## 0.0.8 + +- Synced upstream `gemini-cli` to v0.1.19. +- Updated documentation branding from **Gemini CLI** to **Qwen Code**. +- Added multilingual docs links in `README.md`. +- Added deterministic cache control for the DashScope provider. +- Added option to choose a project-level or global save location. +- Limited `grep` results to 25 items by default. +- `grep` now respects `.geminiignore`. +- Miscellaneous improvements and bug fixes. + ## 0.0.7 -- Fix MCP tools -- Fix Web Fetch tool -- Fix Web Search tool, by replacing web search from Google/Gemini to Tavily API -- Fix: Compatible with occasional tool call parameters returned by LLM that are invalid JSON -- Fix: prevent concurrent query submissions on some rare cases -- Fix: incorrect qwen logger exit handler setup -- Fix: seperate static QR code and dynamic spin components -- Sync gemini-cli to v0.1.18 +- Synced upstream `gemini-cli` to v0.1.18. +- Fixed MCP tools. +- Fixed Web Fetch tool. +- Fixed Web Search tool by switching from Google/Gemini to the Tavily API. +- Made tool calls tolerant of invalid-JSON parameters occasionally returned by the LLM. +- Prevented concurrent query submissions in rare cases. +- Corrected Qwen logger exit-handler setup. +- Separated static QR code and dynamic spinner components. ## 0.0.6 -- Add usage statistics logging for Qwen integration -- Make `/init` command respect configured context filename and align docs with QWEN.md -- Fix EPERM error when run `qwen --sandbox` in macOS -- Fix terminal flicker when waiting for login -- Fix `glm-4.5` model request error +- Added usage statistics logging for Qwen integration. +- Made `/init` respect the configured context filename and aligned docs with `QWEN.md`. +- Fixed `EPERM` error when running `qwen --sandbox` on macOS. +- Fixed terminal flicker while waiting for login. +- Fixed `glm-4.5` model request error. ## 0.0.5 -- Support Qwen OAuth login and provide up to 2000 free requests per day -- Sync gemini-cli to v0.1.17 -- Add systemPromptMappings Configuration Feature +- Added Qwen OAuth login and up to 2,000 free requests per day. +- Synced upstream `gemini-cli` to v0.1.17. +- Added the `systemPromptMappings` configuration option. diff --git a/docs/deployment.md b/docs/deployment.md index e59034f4..1154605d 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -41,7 +41,7 @@ For security and isolation, Qwen Code can be run inside a container. This is the You can run the published sandbox image directly. This is useful for environments where you only have Docker and want to run the CLI. ```bash # Run the published sandbox image - docker run --rm -it ghcr.io/qwenlm/qwen-code:0.0.7 + docker run --rm -it ghcr.io/qwenlm/qwen-code:0.0.8 ``` - **Using the `--sandbox` flag:** If you have Qwen Code installed locally (using the standard installation described above), you can instruct it to run inside the sandbox container. diff --git a/package-lock.json b/package-lock.json index 4aabf3cf..99e9079e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@qwen-code/qwen-code", - "version": "0.0.7", + "version": "0.0.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@qwen-code/qwen-code", - "version": "0.0.7", + "version": "0.0.8", "workspaces": [ "packages/*" ], @@ -11758,7 +11758,7 @@ }, "packages/cli": { "name": "@qwen-code/qwen-code", - "version": "0.0.7", + "version": "0.0.8", "dependencies": { "@google/genai": "1.9.0", "@iarna/toml": "^2.2.5", @@ -11963,7 +11963,7 @@ }, "packages/core": { "name": "@qwen-code/qwen-code-core", - "version": "0.0.7", + "version": "0.0.8", "dependencies": { "@google/genai": "1.9.0", "@modelcontextprotocol/sdk": "^1.11.0", @@ -12114,7 +12114,7 @@ }, "packages/test-utils": { "name": "@qwen-code/qwen-code-test-utils", - "version": "0.0.7", + "version": "0.0.8", "license": "Apache-2.0", "devDependencies": { "typescript": "^5.3.3" @@ -12125,7 +12125,7 @@ }, "packages/vscode-ide-companion": { "name": "qwen-code-vscode-ide-companion", - "version": "0.0.7", + "version": "0.0.8", "license": "LICENSE", "dependencies": { "@modelcontextprotocol/sdk": "^1.15.1", diff --git a/package.json b/package.json index aaf96516..56116b52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/qwen-code", - "version": "0.0.7", + "version": "0.0.8", "engines": { "node": ">=20.0.0" }, @@ -13,7 +13,7 @@ "url": "git+https://github.com/QwenLM/qwen-code.git" }, "config": { - "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.7" + "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.8" }, "scripts": { "start": "node scripts/start.js", diff --git a/packages/cli/package.json b/packages/cli/package.json index 1247e954..17573b3a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/qwen-code", - "version": "0.0.7", + "version": "0.0.8", "description": "Qwen Code", "repository": { "type": "git", @@ -25,7 +25,7 @@ "dist" ], "config": { - "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.7" + "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.8" }, "dependencies": { "@google/genai": "1.9.0", diff --git a/packages/core/package.json b/packages/core/package.json index 0555bf99..307c4934 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/qwen-code-core", - "version": "0.0.7", + "version": "0.0.8", "description": "Qwen Code Core", "repository": { "type": "git", diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 676e024c..d8afeae1 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/qwen-code-test-utils", - "version": "0.0.7", + "version": "0.0.8", "private": true, "main": "src/index.ts", "license": "Apache-2.0", diff --git a/packages/vscode-ide-companion/package.json b/packages/vscode-ide-companion/package.json index f6af1d2c..3fbb43a3 100644 --- a/packages/vscode-ide-companion/package.json +++ b/packages/vscode-ide-companion/package.json @@ -2,7 +2,7 @@ "name": "qwen-code-vscode-ide-companion", "displayName": "Qwen Code Companion", "description": "Enable Qwen Code with direct access to your VS Code workspace.", - "version": "0.0.7", + "version": "0.0.8", "publisher": "qwenlm", "icon": "assets/icon.png", "repository": {