Compare commits

..

2 Commits

Author SHA1 Message Date
github-actions[bot]
2a6c16facb chore(release): v0.0.9-nightly.3 2025-08-27 00:11:10 +00:00
tanzhenxin
1b38f96eaa fix: early stop on invalid tool call (#458) 2025-08-26 20:22:44 +08:00
11 changed files with 38 additions and 53 deletions

View File

@@ -69,11 +69,6 @@ This guide provides solutions to common issues and debugging tips, including top
- **Cause:** The `is-in-ci` package checks for the presence of `CI`, `CONTINUOUS_INTEGRATION`, or any environment variable with a `CI_` prefix. When any of these are found, it signals that the environment is non-interactive, which prevents the CLI from starting in its interactive mode.
- **Solution:** If the `CI_` prefixed variable is not needed for the CLI to function, you can temporarily unset it for the command. e.g., `env -u CI_TOKEN qwen`
- **CLI becomes unresponsive during interactive selection dialogs**
- **Issue:** When encountering selection dialogs with numbered options (such as shell command confirmation dialogs), the CLI appears "frozen" and does not respond to keyboard input.
- **Cause:** This was caused by multiple keyboard input handlers (`useKeypress` hooks) being active simultaneously, creating conflicts in terminal raw mode control.
- **Solution:** This issue has been fixed in recent versions. The keyboard input handling has been consolidated to prevent conflicts. If you encounter this issue, ensure you're using the latest version of Qwen Code.
- **DEBUG mode not working from project .env file**
- **Issue:** Setting `DEBUG=true` in a project's `.env` file doesn't enable debug mode for the CLI.
- **Cause:** The `DEBUG` and `DEBUG_MODE` variables are automatically excluded from project `.env` files to prevent interference with the CLI behavior.

12
package-lock.json generated
View File

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

View File

@@ -1,6 +1,6 @@
{
"name": "@qwen-code/qwen-code",
"version": "0.0.8",
"version": "0.0.9-nightly.3",
"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.8"
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.9-nightly.3"
},
"scripts": {
"start": "node scripts/start.js",

View File

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

View File

@@ -8,6 +8,7 @@ import { ToolConfirmationOutcome } from '@qwen-code/qwen-code-core';
import { Box, Text } from 'ink';
import React from 'react';
import { Colors } from '../colors.js';
import { useKeypress } from '../hooks/useKeypress.js';
import {
RadioButtonSelect,
RadioSelectItem,
@@ -30,6 +31,15 @@ export const ShellConfirmationDialog: React.FC<
> = ({ request }) => {
const { commands, onConfirm } = request;
useKeypress(
(key) => {
if (key.name === 'escape') {
onConfirm(ToolConfirmationOutcome.Cancel);
}
},
{ isActive: true },
);
const handleSelect = (item: ToolConfirmationOutcome) => {
if (item === ToolConfirmationOutcome.Cancel) {
onConfirm(item);
@@ -40,10 +50,6 @@ export const ShellConfirmationDialog: React.FC<
}
};
const handleEscape = () => {
onConfirm(ToolConfirmationOutcome.Cancel);
};
const options: Array<RadioSelectItem<ToolConfirmationOutcome>> = [
{
label: 'Yes, allow once',
@@ -90,12 +96,7 @@ export const ShellConfirmationDialog: React.FC<
<Text>Do you want to proceed?</Text>
</Box>
<RadioButtonSelect
items={options}
onSelect={handleSelect}
onEscape={handleEscape}
isFocused
/>
<RadioButtonSelect items={options} onSelect={handleSelect} isFocused />
</Box>
);
};

View File

@@ -20,6 +20,7 @@ import {
RadioSelectItem,
} from '../shared/RadioButtonSelect.js';
import { MaxSizedBox } from '../shared/MaxSizedBox.js';
import { useKeypress } from '../../hooks/useKeypress.js';
export interface ToolConfirmationMessageProps {
confirmationDetails: ToolCallConfirmationDetails;
@@ -56,10 +57,17 @@ export const ToolConfirmationMessage: React.FC<
onConfirm(outcome);
};
const handleSelect = (item: ToolConfirmationOutcome) => handleConfirm(item);
useKeypress(
(key) => {
if (!isFocused) return;
if (key.name === 'escape' || (key.ctrl && key.name === 'c')) {
handleConfirm(ToolConfirmationOutcome.Cancel);
}
},
{ isActive: isFocused },
);
const handleEscape = () => handleConfirm(ToolConfirmationOutcome.Cancel);
const handleCancel = () => handleConfirm(ToolConfirmationOutcome.Cancel);
const handleSelect = (item: ToolConfirmationOutcome) => handleConfirm(item);
let bodyContent: React.ReactNode | null = null; // Removed contextDisplay here
let question: string;
@@ -275,8 +283,6 @@ export const ToolConfirmationMessage: React.FC<
<RadioButtonSelect
items={options}
onSelect={handleSelect}
onEscape={handleEscape}
onCancel={handleCancel}
isFocused={isFocused}
/>
</Box>

View File

@@ -34,10 +34,6 @@ export interface RadioButtonSelectProps<T> {
onSelect: (value: T) => void;
/** Function called when an item is highlighted. Receives the `value` of the selected item. */
onHighlight?: (value: T) => void;
/** Function called when escape key is pressed. */
onEscape?: () => void;
/** Function called when Ctrl+C is pressed. */
onCancel?: () => void;
/** Whether this select input is currently focused and should respond to input. */
isFocused?: boolean;
/** Whether to show the scroll arrows. */
@@ -59,8 +55,6 @@ export function RadioButtonSelect<T>({
initialIndex = 0,
onSelect,
onHighlight,
onEscape,
onCancel,
isFocused,
showScrollArrows = false,
maxItemsToShow = 10,
@@ -97,18 +91,6 @@ export function RadioButtonSelect<T>({
const { sequence, name } = key;
const isNumeric = showNumbers && /^[0-9]$/.test(sequence);
// Handle escape key
if (name === 'escape') {
onEscape?.();
return;
}
// Handle Ctrl+C
if (key.ctrl && name === 'c') {
onCancel?.();
return;
}
// Any key press that is not a digit should clear the number input buffer.
if (!isNumeric && numberInputTimer.current) {
clearTimeout(numberInputTimer.current);

View File

@@ -644,8 +644,9 @@ export const useGeminiStream = (
options?: { isContinuation: boolean },
prompt_id?: string,
) => {
// Prevent concurrent executions of submitQuery
if (isSubmittingQueryRef.current) {
// Prevent concurrent executions of submitQuery, but allow continuations
// which are part of the same logical flow (tool responses)
if (isSubmittingQueryRef.current && !options?.isContinuation) {
return;
}

View File

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

View File

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

View File

@@ -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.8",
"version": "0.0.9-nightly.3",
"publisher": "qwenlm",
"icon": "assets/icon.png",
"repository": {