More version simplifiction. (#810)

This commit is contained in:
Tommaso Sciortino
2025-06-07 10:54:23 -07:00
committed by GitHub
parent 63757d6a7a
commit 680f4cdd61
8 changed files with 13 additions and 65 deletions

View File

@@ -217,7 +217,6 @@ describe('App UI', () => {
<App
config={mockConfig as unknown as ServerConfig}
settings={mockSettings}
cliVersion="1.0.0"
/>,
);
currentUnmount = unmount;
@@ -234,7 +233,6 @@ describe('App UI', () => {
<App
config={mockConfig as unknown as ServerConfig}
settings={mockSettings}
cliVersion="1.0.0"
/>,
);
currentUnmount = unmount;
@@ -255,7 +253,6 @@ describe('App UI', () => {
<App
config={mockConfig as unknown as ServerConfig}
settings={mockSettings}
cliVersion="1.0.0"
/>,
);
currentUnmount = unmount;
@@ -276,7 +273,6 @@ describe('App UI', () => {
<App
config={mockConfig as unknown as ServerConfig}
settings={mockSettings}
cliVersion="1.0.0"
/>,
);
currentUnmount = unmount;
@@ -297,7 +293,6 @@ describe('App UI', () => {
<App
config={mockConfig as unknown as ServerConfig}
settings={mockSettings}
cliVersion="1.0.0"
/>,
);
currentUnmount = unmount;
@@ -317,7 +312,6 @@ describe('App UI', () => {
<App
config={mockConfig as unknown as ServerConfig}
settings={mockSettings}
cliVersion="1.0.0"
/>,
);
currentUnmount = unmount;
@@ -338,7 +332,6 @@ describe('App UI', () => {
<App
config={mockConfig as unknown as ServerConfig}
settings={mockSettings}
cliVersion="1.0.0"
/>,
);
currentUnmount = unmount;
@@ -368,7 +361,6 @@ describe('App UI', () => {
<App
config={mockConfig as unknown as ServerConfig}
settings={mockSettings}
cliVersion="1.0.0"
/>,
);
currentUnmount = unmount;
@@ -383,7 +375,6 @@ describe('App UI', () => {
<App
config={mockConfig as unknown as ServerConfig}
settings={mockSettings}
cliVersion="1.0.0"
/>,
);
currentUnmount = unmount;

View File

@@ -55,16 +55,10 @@ const CTRL_C_PROMPT_DURATION_MS = 1000;
interface AppProps {
config: Config;
settings: LoadedSettings;
cliVersion: string;
startupWarnings?: string[];
}
export const App = ({
config,
settings,
cliVersion,
startupWarnings = [],
}: AppProps) => {
export const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
const { history, addItem, clearItems } = useHistory();
const {
consoleMessages,
@@ -196,7 +190,6 @@ export const App = ({
openThemeDialog,
performMemoryRefresh,
toggleCorgiMode,
cliVersion,
);
const { streamingState, submitQuery, initError, pendingHistoryItems } =

View File

@@ -115,7 +115,6 @@ describe('useSlashCommandProcessor', () => {
mockOpenThemeDialog,
mockPerformMemoryRefresh,
mockCorgiMode,
'test-version',
),
);
return result.current;
@@ -253,8 +252,8 @@ describe('useSlashCommandProcessor', () => {
description?: string,
sandboxEnvVar?: string,
seatbeltProfileVar?: string,
cliVersion?: string,
) => {
const cliVersion = 'test-version';
const osVersion = 'test-platform test-node-version';
let sandboxEnvStr = 'no sandbox';
if (sandboxEnvVar && sandboxEnvVar !== 'sandbox-exec') {
@@ -293,12 +292,14 @@ Add any other context about the problem here.
it('should call open with the correct GitHub issue URL and return true', async () => {
process.env.SANDBOX = 'gemini-sandbox';
process.env.SEATBELT_PROFILE = 'test_profile';
process.env.CLI_VERSION = 'test-version';
const { handleSlashCommand } = getProcessor();
const bugDescription = 'This is a test bug';
const expectedUrl = getExpectedUrl(
bugDescription,
process.env.SANDBOX,
process.env.SEATBELT_PROFILE,
process.env.CLI_VERSION,
);
let commandResult: SlashCommandActionReturn | boolean = false;
await act(async () => {

View File

@@ -14,6 +14,7 @@ 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';
import { getCliVersion } from '../../utils/version.js';
export interface SlashCommandActionReturn {
shouldScheduleTool?: boolean;
@@ -46,7 +47,6 @@ export const useSlashCommandProcessor = (
openThemeDialog: () => void,
performMemoryRefresh: () => Promise<void>,
toggleCorgiMode: () => void,
cliVersion: string,
) => {
const addMessage = useCallback(
(message: Message) => {
@@ -193,7 +193,7 @@ export const useSlashCommandProcessor = (
name: 'about',
description: 'Show version info',
action: (_mainCommand, _subCommand, _args) => {
const osVersion = `${process.platform} ${process.version}`;
const osVersion = process.platform;
let sandboxEnv = 'no sandbox';
if (process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec') {
sandboxEnv = process.env.SANDBOX;
@@ -201,7 +201,7 @@ export const useSlashCommandProcessor = (
sandboxEnv = `sandbox-exec (${process.env.SEATBELT_PROFILE || 'unknown'})`;
}
const modelVersion = config?.getModel() || 'Unknown';
const cliVersion = getCliVersion();
addMessage({
type: MessageType.ABOUT,
timestamp: new Date(),
@@ -231,6 +231,7 @@ export const useSlashCommandProcessor = (
}
const modelVersion = config?.getModel() || 'Unknown';
const memoryUsage = formatMemoryUsage(process.memoryUsage().rss);
const cliVersion = getCliVersion();
const diagnosticInfo = `
## Describe the bug
@@ -299,7 +300,6 @@ Add any other context about the problem here.
addMessage,
toggleCorgiMode,
config,
cliVersion,
],
);