Merge branch 'main' into chore/sync-gemini-cli-v0.1.21

This commit is contained in:
tanzhenxin
2025-08-22 17:15:40 +08:00
11 changed files with 58 additions and 34 deletions

View File

@@ -1,26 +1,37 @@
# Changelog # 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 ## 0.0.7
- Fix MCP tools - Synced upstream `gemini-cli` to v0.1.18.
- Fix Web Fetch tool - Fixed MCP tools.
- Fix Web Search tool, by replacing web search from Google/Gemini to Tavily API - Fixed Web Fetch tool.
- Fix: Compatible with occasional tool call parameters returned by LLM that are invalid JSON - Fixed Web Search tool by switching from Google/Gemini to the Tavily API.
- Fix: prevent concurrent query submissions on some rare cases - Made tool calls tolerant of invalid-JSON parameters occasionally returned by the LLM.
- Fix: incorrect qwen logger exit handler setup - Prevented concurrent query submissions in rare cases.
- Fix: seperate static QR code and dynamic spin components - Corrected Qwen logger exit-handler setup.
- Sync gemini-cli to v0.1.18 - Separated static QR code and dynamic spinner components.
## 0.0.6 ## 0.0.6
- Add usage statistics logging for Qwen integration - Added usage statistics logging for Qwen integration.
- Make `/init` command respect configured context filename and align docs with QWEN.md - Made `/init` respect the configured context filename and aligned docs with `QWEN.md`.
- Fix EPERM error when run `qwen --sandbox` in macOS - Fixed `EPERM` error when running `qwen --sandbox` on macOS.
- Fix terminal flicker when waiting for login - Fixed terminal flicker while waiting for login.
- Fix `glm-4.5` model request error - Fixed `glm-4.5` model request error.
## 0.0.5 ## 0.0.5
- Support Qwen OAuth login and provide up to 2000 free requests per day - Added Qwen OAuth login and up to 2,000 free requests per day.
- Sync gemini-cli to v0.1.17 - Synced upstream `gemini-cli` to v0.1.17.
- Add systemPromptMappings Configuration Feature - Added the `systemPromptMappings` configuration option.

View File

@@ -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. 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 ```bash
# Run the published sandbox image # 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:** - **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. If you have Qwen Code installed locally (using the standard installation described above), you can instruct it to run inside the sandbox container.

12
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.0.7", "version": "0.0.8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.0.7", "version": "0.0.8",
"workspaces": [ "workspaces": [
"packages/*" "packages/*"
], ],
@@ -12336,7 +12336,7 @@
}, },
"packages/cli": { "packages/cli": {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.0.7", "version": "0.0.8",
"dependencies": { "dependencies": {
"@google/genai": "1.9.0", "@google/genai": "1.9.0",
"@iarna/toml": "^2.2.5", "@iarna/toml": "^2.2.5",
@@ -12520,7 +12520,7 @@
}, },
"packages/core": { "packages/core": {
"name": "@qwen-code/qwen-code-core", "name": "@qwen-code/qwen-code-core",
"version": "0.0.7", "version": "0.0.8",
"dependencies": { "dependencies": {
"@google/genai": "1.13.0", "@google/genai": "1.13.0",
"@modelcontextprotocol/sdk": "^1.11.0", "@modelcontextprotocol/sdk": "^1.11.0",
@@ -12671,7 +12671,7 @@
}, },
"packages/test-utils": { "packages/test-utils": {
"name": "@qwen-code/qwen-code-test-utils", "name": "@qwen-code/qwen-code-test-utils",
"version": "0.0.7", "version": "0.0.8",
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": { "devDependencies": {
"typescript": "^5.3.3" "typescript": "^5.3.3"
@@ -12682,7 +12682,7 @@
}, },
"packages/vscode-ide-companion": { "packages/vscode-ide-companion": {
"name": "qwen-code-vscode-ide-companion", "name": "qwen-code-vscode-ide-companion",
"version": "0.0.7", "version": "0.0.8",
"license": "LICENSE", "license": "LICENSE",
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.15.1", "@modelcontextprotocol/sdk": "^1.15.1",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.0.7", "version": "0.0.8",
"engines": { "engines": {
"node": ">=20.0.0" "node": ">=20.0.0"
}, },
@@ -13,7 +13,7 @@
"url": "git+https://github.com/QwenLM/qwen-code.git" "url": "git+https://github.com/QwenLM/qwen-code.git"
}, },
"config": { "config": {
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.7" "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.8"
}, },
"scripts": { "scripts": {
"start": "node scripts/start.js", "start": "node scripts/start.js",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.0.7", "version": "0.0.8",
"description": "Qwen Code", "description": "Qwen Code",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -25,7 +25,7 @@
"dist" "dist"
], ],
"config": { "config": {
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.7" "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.8"
}, },
"dependencies": { "dependencies": {
"@google/genai": "1.9.0", "@google/genai": "1.9.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@qwen-code/qwen-code-core", "name": "@qwen-code/qwen-code-core",
"version": "0.0.7", "version": "0.0.8",
"description": "Qwen Code Core", "description": "Qwen Code Core",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@@ -509,7 +509,20 @@ export class GeminiClient {
} }
} }
if (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.getIdeMode() && !hasPendingToolCall) {
const { contextParts, newIdeContext } = this.getIdeContextParts( const { contextParts, newIdeContext } = this.getIdeContextParts(
this.forceFullIdeContext || this.getHistory().length === 0, this.forceFullIdeContext || this.getHistory().length === 0,
); );

View File

@@ -129,6 +129,7 @@ export class OpenAIContentGenerator implements ContentGenerator {
: isDashScopeProvider : isDashScopeProvider
? { ? {
'X-DashScope-CacheControl': 'enable', 'X-DashScope-CacheControl': 'enable',
'X-DashScope-UserAgent': userAgent,
} }
: {}), : {}),
}; };

View File

@@ -5,7 +5,6 @@
*/ */
import { BaseTool, Kind, ToolResult } from './tools.js'; import { BaseTool, Kind, ToolResult } from './tools.js';
import { Type } from '@google/genai';
import { SchemaValidator } from '../utils/schemaValidator.js'; import { SchemaValidator } from '../utils/schemaValidator.js';
import { getErrorMessage } from '../utils/errors.js'; import { getErrorMessage } from '../utils/errors.js';
import { Config } from '../config/config.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.', 'Performs a web search using the Tavily API and returns a concise answer with sources. Requires the TAVILY_API_KEY environment variable.',
Kind.Search, Kind.Search,
{ {
type: Type.OBJECT, type: 'object',
properties: { properties: {
query: { query: {
type: Type.STRING, type: 'string',
description: 'The search query to find information on the web.', description: 'The search query to find information on the web.',
}, },
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@qwen-code/qwen-code-test-utils", "name": "@qwen-code/qwen-code-test-utils",
"version": "0.0.7", "version": "0.0.8",
"private": true, "private": true,
"main": "src/index.ts", "main": "src/index.ts",
"license": "Apache-2.0", "license": "Apache-2.0",

View File

@@ -2,7 +2,7 @@
"name": "qwen-code-vscode-ide-companion", "name": "qwen-code-vscode-ide-companion",
"displayName": "Qwen Code Companion", "displayName": "Qwen Code Companion",
"description": "Enable Qwen Code with direct access to your VS Code workspace.", "description": "Enable Qwen Code with direct access to your VS Code workspace.",
"version": "0.0.7", "version": "0.0.8",
"publisher": "qwenlm", "publisher": "qwenlm",
"icon": "assets/icon.png", "icon": "assets/icon.png",
"repository": { "repository": {