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

View File

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

View File

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

View File

@@ -5,6 +5,7 @@
*/
import type {
ContentGeneratorConfig,
FileFilteringOptions,
MCPServerConfig,
OutputFormat,
@@ -123,6 +124,24 @@ export interface CliArgs {
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> {
const rawArgv = hideBin(process.argv);
const yargsInstance = yargs(rawArgv)
@@ -685,6 +704,7 @@ export async function loadCliConfig(
const vlmSwitchMode =
argv.vlmSwitchMode || settings.experimental?.vlmSwitchMode;
const legacySamplingParams = getLegacySamplingParams(settings);
return new Config({
sessionId,
embeddingModel: DEFAULT_QWEN_EMBEDDING_MODEL,
@@ -745,6 +765,8 @@ export async function loadCliConfig(
(typeof argv.openaiLogging === 'undefined'
? settings.model?.enableOpenAILogging
: argv.openaiLogging) ?? false,
// Include sampling_params from root level settings
...(legacySamplingParams ? { samplingParams: legacySamplingParams } : {}),
},
cliVersion: await getCliVersion(),
tavilyApiKey:

View File

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

View File

@@ -89,9 +89,9 @@ const listCommand: SlashCommand = {
const isoString = chat.mtime.toISOString();
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';
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 {
type: 'message',
messageType: 'info',

View File

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

View File

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

View File

@@ -149,10 +149,7 @@ const COMPRESSION_PRESERVE_THRESHOLD = 0.3;
export class GeminiClient {
private chat?: GeminiChat;
private readonly generateContentConfig: GenerateContentConfig = {
temperature: 0,
topP: 1,
};
private readonly generateContentConfig: GenerateContentConfig;
private sessionTurnCount = 0;
private readonly loopDetector: LoopDetectionService;
@@ -169,6 +166,44 @@ export class GeminiClient {
constructor(private readonly config: Config) {
this.loopDetector = new LoopDetectionService(config);
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() {

View File

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