mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-19 18:40:57 -07:00
Use IdeClient directly instead of config.ideClient (#7627)
This commit is contained in:
committed by
GitHub
parent
45d494a8d8
commit
cb43bb9ca4
@@ -15,7 +15,7 @@ import { MessageType } from '../types.js';
|
||||
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
|
||||
import { formatMemoryUsage } from '../utils/formatters.js';
|
||||
import { getCliVersion } from '../../utils/version.js';
|
||||
import { sessionId } from '@google/gemini-cli-core';
|
||||
import { IdeClient, sessionId } from '@google/gemini-cli-core';
|
||||
|
||||
export const bugCommand: SlashCommand = {
|
||||
name: 'bug',
|
||||
@@ -37,10 +37,7 @@ export const bugCommand: SlashCommand = {
|
||||
const modelVersion = config?.getModel() || 'Unknown';
|
||||
const cliVersion = await getCliVersion();
|
||||
const memoryUsage = formatMemoryUsage(process.memoryUsage().rss);
|
||||
const ideClient =
|
||||
(context.services.config?.getIdeMode() &&
|
||||
context.services.config?.getIdeClient()?.getDetectedIdeDisplayName()) ||
|
||||
'';
|
||||
const ideClient = await getIdeClientName(context);
|
||||
|
||||
let info = `
|
||||
* **CLI Version:** ${cliVersion}
|
||||
@@ -90,3 +87,11 @@ export const bugCommand: SlashCommand = {
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
async function getIdeClientName(context: CommandContext) {
|
||||
if (!context.services.config?.getIdeMode()) {
|
||||
return '';
|
||||
}
|
||||
const ideClient = await IdeClient.getInstance();
|
||||
return ideClient.getDetectedIdeDisplayName() ?? '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user