Compare commits

..

5 Commits

Author SHA1 Message Date
koalazf.99
5854ac67c6 fix sampling params 2025-12-11 13:46:37 +08:00
koalazf.99
354c85bcff revert: topp & temperature default velue to none 2025-10-28 13:00:10 +08:00
pomelo-nwu
7ccba75621 test: update /chat list test to match plain text output
Updated the test expectations to match the new plain text format
without ANSI escape codes.
2025-10-28 09:15:07 +08:00
pomelo-nwu
e0e5fa5084 fix: remove hardcoded ANSI escape codes in /chat list command
The /chat list command was displaying raw ANSI escape codes instead of
colored text. This was caused by the escapeAnsiCtrlCodes function in
HistoryItemDisplay that escapes all ANSI control characters.

Changed to plain text format for better compatibility and cleaner output.
2025-10-28 09:14:00 +08:00
tanzhenxin
65cf80f4ab chore: pump version to 0.1.1 (#883) 2025-10-27 19:32:52 +08:00
11 changed files with 79 additions and 25 deletions

12
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.1.0", "version": "0.1.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.1.0", "version": "0.1.1",
"workspaces": [ "workspaces": [
"packages/*" "packages/*"
], ],
@@ -16024,7 +16024,7 @@
}, },
"packages/cli": { "packages/cli": {
"name": "@qwen-code/qwen-code", "name": "@qwen-code/qwen-code",
"version": "0.1.0", "version": "0.1.1",
"dependencies": { "dependencies": {
"@google/genai": "1.16.0", "@google/genai": "1.16.0",
"@iarna/toml": "^2.2.5", "@iarna/toml": "^2.2.5",
@@ -16139,7 +16139,7 @@
}, },
"packages/core": { "packages/core": {
"name": "@qwen-code/qwen-code-core", "name": "@qwen-code/qwen-code-core",
"version": "0.1.0", "version": "0.1.1",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@google/genai": "1.16.0", "@google/genai": "1.16.0",
@@ -16278,7 +16278,7 @@
}, },
"packages/test-utils": { "packages/test-utils": {
"name": "@qwen-code/qwen-code-test-utils", "name": "@qwen-code/qwen-code-test-utils",
"version": "0.1.0", "version": "0.1.1",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": { "devDependencies": {
@@ -16290,7 +16290,7 @@
}, },
"packages/vscode-ide-companion": { "packages/vscode-ide-companion": {
"name": "qwen-code-vscode-ide-companion", "name": "qwen-code-vscode-ide-companion",
"version": "0.1.0", "version": "0.1.1",
"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.1.0", "version": "0.1.1",
"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.1.0" "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.1"
}, },
"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.1.0", "version": "0.1.1",
"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.1.0" "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.1"
}, },
"dependencies": { "dependencies": {
"@google/genai": "1.16.0", "@google/genai": "1.16.0",

View File

@@ -5,6 +5,7 @@
*/ */
import type { import type {
ContentGeneratorConfig,
FileFilteringOptions, FileFilteringOptions,
MCPServerConfig, MCPServerConfig,
OutputFormat, OutputFormat,
@@ -123,6 +124,24 @@ export interface CliArgs {
outputFormat: string | undefined; outputFormat: string | undefined;
} }
type LegacySamplingSettings = {
sampling_params?: ContentGeneratorConfig['samplingParams'];
};
function getLegacySamplingParams(
settings: Settings,
): ContentGeneratorConfig['samplingParams'] | undefined {
if (
typeof settings !== 'object' ||
settings === null ||
!('sampling_params' in (settings as Record<string, unknown>))
) {
return undefined;
}
return (settings as Settings & LegacySamplingSettings).sampling_params;
}
export async function parseArguments(settings: Settings): Promise<CliArgs> { export async function parseArguments(settings: Settings): Promise<CliArgs> {
const rawArgv = hideBin(process.argv); const rawArgv = hideBin(process.argv);
const yargsInstance = yargs(rawArgv) const yargsInstance = yargs(rawArgv)
@@ -685,6 +704,7 @@ export async function loadCliConfig(
const vlmSwitchMode = const vlmSwitchMode =
argv.vlmSwitchMode || settings.experimental?.vlmSwitchMode; argv.vlmSwitchMode || settings.experimental?.vlmSwitchMode;
const legacySamplingParams = getLegacySamplingParams(settings);
return new Config({ return new Config({
sessionId, sessionId,
embeddingModel: DEFAULT_QWEN_EMBEDDING_MODEL, embeddingModel: DEFAULT_QWEN_EMBEDDING_MODEL,
@@ -745,6 +765,8 @@ export async function loadCliConfig(
(typeof argv.openaiLogging === 'undefined' (typeof argv.openaiLogging === 'undefined'
? settings.model?.enableOpenAILogging ? settings.model?.enableOpenAILogging
: argv.openaiLogging) ?? false, : argv.openaiLogging) ?? false,
// Include sampling_params from root level settings
...(legacySamplingParams ? { samplingParams: legacySamplingParams } : {}),
}, },
cliVersion: await getCliVersion(), cliVersion: await getCliVersion(),
tavilyApiKey: tavilyApiKey:

View File

@@ -139,8 +139,8 @@ describe('chatCommand', () => {
.match(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/); .match(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);
const formattedDate = isoDate ? `${isoDate[1]} ${isoDate[2]}` : ''; const formattedDate = isoDate ? `${isoDate[1]} ${isoDate[2]}` : '';
expect(content).toContain(formattedDate); expect(content).toContain(formattedDate);
const index1 = content.indexOf('- \u001b[36mtest1\u001b[0m'); const index1 = content.indexOf('- test1');
const index2 = content.indexOf('- \u001b[36mtest2\u001b[0m'); const index2 = content.indexOf('- test2');
expect(index1).toBeGreaterThanOrEqual(0); expect(index1).toBeGreaterThanOrEqual(0);
expect(index2).toBeGreaterThan(index1); expect(index2).toBeGreaterThan(index1);
}); });

View File

@@ -89,9 +89,9 @@ const listCommand: SlashCommand = {
const isoString = chat.mtime.toISOString(); const isoString = chat.mtime.toISOString();
const match = isoString.match(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/); const match = isoString.match(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);
const formattedDate = match ? `${match[1]} ${match[2]}` : 'Invalid Date'; const formattedDate = match ? `${match[1]} ${match[2]}` : 'Invalid Date';
message += ` - \u001b[36m${paddedName}\u001b[0m \u001b[90m(saved on ${formattedDate})\u001b[0m\n`; message += ` - ${paddedName} (saved on ${formattedDate})\n`;
} }
message += `\n\u001b[90mNote: Newest last, oldest first\u001b[0m`; message += `\nNote: Newest last, oldest first`;
return { return {
type: 'message', type: 'message',
messageType: 'info', messageType: 'info',

View File

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

View File

@@ -65,10 +65,7 @@ export interface GenerateJsonOptions {
*/ */
export class BaseLlmClient { export class BaseLlmClient {
// Default configuration for utility tasks // Default configuration for utility tasks
private readonly defaultUtilityConfig: GenerateContentConfig = { private readonly defaultUtilityConfig: GenerateContentConfig = {};
temperature: 0,
topP: 1,
};
constructor( constructor(
private readonly contentGenerator: ContentGenerator, private readonly contentGenerator: ContentGenerator,

View File

@@ -149,10 +149,7 @@ const COMPRESSION_PRESERVE_THRESHOLD = 0.3;
export class GeminiClient { export class GeminiClient {
private chat?: GeminiChat; private chat?: GeminiChat;
private readonly generateContentConfig: GenerateContentConfig = { private readonly generateContentConfig: GenerateContentConfig;
temperature: 0,
topP: 1,
};
private sessionTurnCount = 0; private sessionTurnCount = 0;
private readonly loopDetector: LoopDetectionService; private readonly loopDetector: LoopDetectionService;
@@ -169,6 +166,44 @@ export class GeminiClient {
constructor(private readonly config: Config) { constructor(private readonly config: Config) {
this.loopDetector = new LoopDetectionService(config); this.loopDetector = new LoopDetectionService(config);
this.lastPromptId = this.config.getSessionId(); this.lastPromptId = this.config.getSessionId();
this.generateContentConfig = this.buildDefaultGenerateContentConfig();
}
private buildDefaultGenerateContentConfig(): GenerateContentConfig {
const samplingParams =
this.config.getContentGeneratorConfig()?.samplingParams;
if (!samplingParams) {
return {};
}
const config: GenerateContentConfig = {};
if (samplingParams.temperature !== undefined) {
config.temperature = samplingParams.temperature;
}
if (samplingParams.top_p !== undefined) {
config.topP = samplingParams.top_p;
}
if (samplingParams.top_k !== undefined) {
config.topK = samplingParams.top_k;
}
if (samplingParams.max_tokens !== undefined) {
config.maxOutputTokens = samplingParams.max_tokens;
}
if (samplingParams.presence_penalty !== undefined) {
config.presencePenalty = samplingParams.presence_penalty;
}
if (samplingParams.frequency_penalty !== undefined) {
config.frequencyPenalty = samplingParams.frequency_penalty;
}
return config;
} }
async initialize() { async initialize() {

View File

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