Compare commits

...

4 Commits

Author SHA1 Message Date
github-actions[bot]
40959d6cb1 chore(release): v0.6.2 2026-01-12 04:27:53 +00:00
tanzhenxin
5c884fd395 fix(core): handle missing delta in OpenAI stream chunks
Some OpenAI-compatible providers occasionally emit chat.completion.chunk choices
without a delta object. Guard optional reasoning_content access and add a
regression test to ensure chunk conversion does not throw.
2026-01-12 11:49:00 +08:00
xuewenjie
0073c77267 fix(shell): prevent console window flash on Windows for foreground tasks 2026-01-12 11:48:28 +08:00
xuewenjie
418aeb069d test: update shellExecutionService test for Windows spawn config changes 2026-01-12 11:48:28 +08:00
10 changed files with 40 additions and 17 deletions

12
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.6.1", "version": "0.6.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.6.1", "version": "0.6.2",
"workspaces": [ "workspaces": [
"packages/*" "packages/*"
], ],
@@ -17316,7 +17316,7 @@
}, },
"packages/cli": { "packages/cli": {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.6.1", "version": "0.6.2",
"dependencies": { "dependencies": {
"@google/genai": "1.30.0", "@google/genai": "1.30.0",
"@iarna/toml": "^2.2.5", "@iarna/toml": "^2.2.5",
@@ -17953,7 +17953,7 @@
}, },
"packages/core": { "packages/core": {
"name": "@qwen-code/qwen-code-core", "name": "@qwen-code/qwen-code-core",
"version": "0.6.1", "version": "0.6.2",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@anthropic-ai/sdk": "^0.36.1", "@anthropic-ai/sdk": "^0.36.1",
@@ -21413,7 +21413,7 @@
}, },
"packages/test-utils": { "packages/test-utils": {
"name": "@qwen-code/qwen-code-test-utils", "name": "@qwen-code/qwen-code-test-utils",
"version": "0.6.1", "version": "0.6.2",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": { "devDependencies": {
@@ -21425,7 +21425,7 @@
}, },
"packages/vscode-ide-companion": { "packages/vscode-ide-companion": {
"name": "qwen-code-vscode-ide-companion", "name": "qwen-code-vscode-ide-companion",
"version": "0.6.1", "version": "0.6.2",
"license": "LICENSE", "license": "LICENSE",
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.25.1", "@modelcontextprotocol/sdk": "^1.25.1",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.6.1", "version": "0.6.2",
"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.6.1" "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.6.2"
}, },
"scripts": { "scripts": {
"start": "cross-env node scripts/start.js", "start": "cross-env node scripts/start.js",

View File

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

View File

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

View File

@@ -207,6 +207,27 @@ describe('OpenAIContentConverter', () => {
expect.objectContaining({ text: 'visible text' }), expect.objectContaining({ text: 'visible text' }),
); );
}); });
it('should not throw when streaming chunk has no delta', () => {
const chunk = converter.convertOpenAIChunkToGemini({
object: 'chat.completion.chunk',
id: 'chunk-2',
created: 456,
choices: [
{
index: 0,
// Some OpenAI-compatible providers may omit delta entirely.
delta: undefined,
finish_reason: null,
logprobs: null,
},
],
model: 'gpt-test',
} as unknown as OpenAI.Chat.ChatCompletionChunk);
const parts = chunk.candidates?.[0]?.content?.parts;
expect(parts).toEqual([]);
});
}); });
describe('convertGeminiToolsToOpenAI', () => { describe('convertGeminiToolsToOpenAI', () => {

View File

@@ -791,7 +791,7 @@ export class OpenAIContentConverter {
const parts: Part[] = []; const parts: Part[] = [];
const reasoningText = (choice.delta as ExtendedCompletionChunkDelta) const reasoningText = (choice.delta as ExtendedCompletionChunkDelta)
.reasoning_content; ?.reasoning_content;
if (reasoningText) { if (reasoningText) {
parts.push({ text: reasoningText, thought: true }); parts.push({ text: reasoningText, thought: true });
} }

View File

@@ -818,7 +818,7 @@ describe('ShellExecutionService child_process fallback', () => {
}); });
describe('Platform-Specific Behavior', () => { describe('Platform-Specific Behavior', () => {
it('should use cmd.exe on Windows', async () => { it('should use cmd.exe and hide window on Windows', async () => {
mockPlatform.mockReturnValue('win32'); mockPlatform.mockReturnValue('win32');
await simulateExecution('dir "foo bar"', (cp) => await simulateExecution('dir "foo bar"', (cp) =>
cp.emit('exit', 0, null), cp.emit('exit', 0, null),
@@ -829,7 +829,8 @@ describe('ShellExecutionService child_process fallback', () => {
[], [],
expect.objectContaining({ expect.objectContaining({
shell: true, shell: true,
detached: true, detached: false,
windowsHide: true,
}), }),
); );
}); });

View File

@@ -229,7 +229,8 @@ export class ShellExecutionService {
stdio: ['ignore', 'pipe', 'pipe'], stdio: ['ignore', 'pipe', 'pipe'],
windowsVerbatimArguments: true, windowsVerbatimArguments: true,
shell: isWindows ? true : 'bash', shell: isWindows ? true : 'bash',
detached: true, detached: !isWindows,
windowsHide: isWindows,
env: { env: {
...process.env, ...process.env,
QWEN_CODE: '1', QWEN_CODE: '1',

View File

@@ -1,6 +1,6 @@
{ {
"name": "@qwen-code/qwen-code-test-utils", "name": "@qwen-code/qwen-code-test-utils",
"version": "0.6.1", "version": "0.6.2",
"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.6.1", "version": "0.6.2",
"publisher": "qwenlm", "publisher": "qwenlm",
"icon": "assets/icon.png", "icon": "assets/icon.png",
"repository": { "repository": {