mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 06:25:16 -07:00
feat: remove session summary feature (#8545)
This commit is contained in:
@@ -1,37 +0,0 @@
|
|||||||
/**
|
|
||||||
* @license
|
|
||||||
* Copyright 2025 Google LLC
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { TestRig } from './test-helper.js';
|
|
||||||
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
||||||
import { join } from 'node:path';
|
|
||||||
import { readFileSync } from 'node:fs';
|
|
||||||
|
|
||||||
describe('session-summary flag', () => {
|
|
||||||
let rig: TestRig;
|
|
||||||
|
|
||||||
beforeEach(function (context) {
|
|
||||||
rig = new TestRig();
|
|
||||||
if (context.task.name) {
|
|
||||||
rig.setup(context.task.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(async () => {
|
|
||||||
await rig.cleanup();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should write a session summary in non-interactive mode', async () => {
|
|
||||||
const summaryPath = join(rig.testDir!, 'summary.json');
|
|
||||||
await rig.run('Say hello', '--session-summary', summaryPath);
|
|
||||||
|
|
||||||
const summaryContent = readFileSync(summaryPath, 'utf-8');
|
|
||||||
const summary = JSON.parse(summaryContent);
|
|
||||||
|
|
||||||
expect(summary).toBeDefined();
|
|
||||||
expect(summary.sessionMetrics.models).toBeDefined();
|
|
||||||
expect(summary.sessionMetrics.tools).toBeDefined();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -81,7 +81,6 @@ export interface CliArgs {
|
|||||||
includeDirectories: string[] | undefined;
|
includeDirectories: string[] | undefined;
|
||||||
screenReader: boolean | undefined;
|
screenReader: boolean | undefined;
|
||||||
useSmartEdit: boolean | undefined;
|
useSmartEdit: boolean | undefined;
|
||||||
sessionSummary: string | undefined;
|
|
||||||
promptWords: string[] | undefined;
|
promptWords: string[] | undefined;
|
||||||
outputFormat: string | undefined;
|
outputFormat: string | undefined;
|
||||||
}
|
}
|
||||||
@@ -232,10 +231,6 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
|
|||||||
description: 'Enable screen reader mode for accessibility.',
|
description: 'Enable screen reader mode for accessibility.',
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
.option('session-summary', {
|
|
||||||
type: 'string',
|
|
||||||
description: 'File to write session summary to.',
|
|
||||||
})
|
|
||||||
.option('output-format', {
|
.option('output-format', {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'The format of the CLI output.',
|
description: 'The format of the CLI output.',
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ vi.mock('./config/config.js', () => ({
|
|||||||
getSandbox: vi.fn(() => false),
|
getSandbox: vi.fn(() => false),
|
||||||
getQuestion: vi.fn(() => ''),
|
getQuestion: vi.fn(() => ''),
|
||||||
} as unknown as Config),
|
} as unknown as Config),
|
||||||
parseArguments: vi.fn().mockResolvedValue({ sessionSummary: null }),
|
parseArguments: vi.fn().mockResolvedValue({}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('read-package-up', () => ({
|
vi.mock('read-package-up', () => ({
|
||||||
@@ -242,7 +242,6 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|||||||
includeDirectories: undefined,
|
includeDirectories: undefined,
|
||||||
screenReader: undefined,
|
screenReader: undefined,
|
||||||
useSmartEdit: undefined,
|
useSmartEdit: undefined,
|
||||||
sessionSummary: undefined,
|
|
||||||
promptWords: undefined,
|
promptWords: undefined,
|
||||||
outputFormat: undefined,
|
outputFormat: undefined,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import {
|
|||||||
logUserPrompt,
|
logUserPrompt,
|
||||||
AuthType,
|
AuthType,
|
||||||
getOauthClient,
|
getOauthClient,
|
||||||
uiTelemetryService,
|
|
||||||
} from '@google/gemini-cli-core';
|
} from '@google/gemini-cli-core';
|
||||||
import {
|
import {
|
||||||
initializeApp,
|
initializeApp,
|
||||||
@@ -48,7 +47,7 @@ import { checkForUpdates } from './ui/utils/updateCheck.js';
|
|||||||
import { handleAutoUpdate } from './utils/handleAutoUpdate.js';
|
import { handleAutoUpdate } from './utils/handleAutoUpdate.js';
|
||||||
import { appEvents, AppEvent } from './utils/events.js';
|
import { appEvents, AppEvent } from './utils/events.js';
|
||||||
import { SettingsContext } from './ui/contexts/SettingsContext.js';
|
import { SettingsContext } from './ui/contexts/SettingsContext.js';
|
||||||
import { writeFileSync } from 'node:fs';
|
|
||||||
import { SessionStatsProvider } from './ui/contexts/SessionContext.js';
|
import { SessionStatsProvider } from './ui/contexts/SessionContext.js';
|
||||||
import { VimModeProvider } from './ui/contexts/VimModeContext.js';
|
import { VimModeProvider } from './ui/contexts/VimModeContext.js';
|
||||||
import { KeypressProvider } from './ui/contexts/KeypressContext.js';
|
import { KeypressProvider } from './ui/contexts/KeypressContext.js';
|
||||||
@@ -235,15 +234,6 @@ export async function main() {
|
|||||||
// Detect and enable Kitty keyboard protocol once at startup.
|
// Detect and enable Kitty keyboard protocol once at startup.
|
||||||
kittyProtocolDetectionComplete = detectAndEnableKittyProtocol();
|
kittyProtocolDetectionComplete = detectAndEnableKittyProtocol();
|
||||||
}
|
}
|
||||||
if (argv.sessionSummary) {
|
|
||||||
registerCleanup(() => {
|
|
||||||
const metrics = uiTelemetryService.getMetrics();
|
|
||||||
writeFileSync(
|
|
||||||
argv.sessionSummary!,
|
|
||||||
JSON.stringify({ sessionMetrics: metrics }, null, 2),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const consolePatcher = new ConsolePatcher({
|
const consolePatcher = new ConsolePatcher({
|
||||||
stderr: true,
|
stderr: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user