mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
feat: add --show_memory_usage flag to display memory usage in status bar (#606)
This commit is contained in:
@@ -7,11 +7,13 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { type PartListUnion } from '@google/genai';
|
||||
import open from 'open';
|
||||
import process from 'node:process';
|
||||
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
||||
import { Config } from '@gemini-code/server';
|
||||
import { Message, MessageType, HistoryItemWithoutId } from '../types.js';
|
||||
import { createShowMemoryAction } from './useShowMemoryCommand.js';
|
||||
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
|
||||
import { formatMemoryUsage } from '../utils/formatters.js';
|
||||
|
||||
export interface SlashCommandActionReturn {
|
||||
shouldScheduleTool?: boolean;
|
||||
@@ -206,6 +208,7 @@ export const useSlashCommandProcessor = (
|
||||
sandboxEnv = `sandbox-exec (${process.env.SEATBELT_PROFILE || 'unknown'})`;
|
||||
}
|
||||
const modelVersion = config?.getModel() || 'Unknown';
|
||||
const memoryUsage = formatMemoryUsage(process.memoryUsage().rss);
|
||||
|
||||
const diagnosticInfo = `
|
||||
## Describe the bug
|
||||
@@ -220,6 +223,7 @@ Add any other context about the problem here.
|
||||
* **Operating System:** ${osVersion}
|
||||
* **Sandbox Environment:** ${sandboxEnv}
|
||||
* **Model Version:** ${modelVersion}
|
||||
* **Memory Usage:** ${memoryUsage}
|
||||
`;
|
||||
|
||||
let bugReportUrl =
|
||||
|
||||
Reference in New Issue
Block a user