feat: fix sessionId

This commit is contained in:
pomelo-nwu
2025-10-30 16:47:51 +08:00
parent ced79cf4e3
commit 65112f7ebd
2 changed files with 5 additions and 3 deletions

View File

@@ -27,7 +27,6 @@ vi.mock('@qwen-code/qwen-code-core', async (importOriginal) => {
getDetectedIdeDisplayName: vi.fn().mockReturnValue('VSCode'), getDetectedIdeDisplayName: vi.fn().mockReturnValue('VSCode'),
}), }),
}, },
sessionId: 'test-session-id',
}; };
}); });
vi.mock('node:process', () => ({ vi.mock('node:process', () => ({
@@ -59,6 +58,7 @@ describe('bugCommand', () => {
getModel: () => 'qwen3-coder-plus', getModel: () => 'qwen3-coder-plus',
getBugCommand: () => undefined, getBugCommand: () => undefined,
getIdeMode: () => true, getIdeMode: () => true,
getSessionId: () => 'test-session-id',
}, },
settings: { settings: {
merged: { merged: {
@@ -102,6 +102,7 @@ describe('bugCommand', () => {
getModel: () => 'qwen3-coder-plus', getModel: () => 'qwen3-coder-plus',
getBugCommand: () => ({ urlTemplate: customTemplate }), getBugCommand: () => ({ urlTemplate: customTemplate }),
getIdeMode: () => true, getIdeMode: () => true,
getSessionId: () => 'test-session-id',
}, },
settings: { settings: {
merged: { merged: {
@@ -143,6 +144,7 @@ describe('bugCommand', () => {
getModel: () => 'qwen3-coder-plus', getModel: () => 'qwen3-coder-plus',
getBugCommand: () => undefined, getBugCommand: () => undefined,
getIdeMode: () => true, getIdeMode: () => true,
getSessionId: () => 'test-session-id',
getContentGeneratorConfig: () => ({ getContentGeneratorConfig: () => ({
baseUrl: 'https://api.openai.com/v1', baseUrl: 'https://api.openai.com/v1',
}), }),

View File

@@ -15,7 +15,7 @@ import { MessageType } from '../types.js';
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js'; import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
import { formatMemoryUsage } from '../utils/formatters.js'; import { formatMemoryUsage } from '../utils/formatters.js';
import { getCliVersion } from '../../utils/version.js'; import { getCliVersion } from '../../utils/version.js';
import { IdeClient, sessionId, AuthType } from '@qwen-code/qwen-code-core'; import { IdeClient, AuthType } from '@qwen-code/qwen-code-core';
export const bugCommand: SlashCommand = { export const bugCommand: SlashCommand = {
name: 'bug', name: 'bug',
@@ -48,7 +48,7 @@ export const bugCommand: SlashCommand = {
let info = ` let info = `
* **CLI Version:** ${cliVersion} * **CLI Version:** ${cliVersion}
* **Git Commit:** ${GIT_COMMIT_INFO} * **Git Commit:** ${GIT_COMMIT_INFO}
* **Session ID:** ${sessionId} * **Session ID:** ${config?.getSessionId() || 'unknown'}
* **Operating System:** ${osVersion} * **Operating System:** ${osVersion}
* **Sandbox Environment:** ${sandboxEnv} * **Sandbox Environment:** ${sandboxEnv}
* **Auth Type:** ${selectedAuthType}`; * **Auth Type:** ${selectedAuthType}`;