feat(core): implement persistent browser session management (#21306)

Co-authored-by: Gaurav <39389231+gsquared94@users.noreply.github.com>
Co-authored-by: cynthialong0-0 <82900738+cynthialong0-0@users.noreply.github.com>
This commit is contained in:
Aditya Bijalwan
2026-03-27 03:03:37 +05:30
committed by GitHub
parent d25ce0e143
commit 73dd7328df
9 changed files with 332 additions and 61 deletions

View File

@@ -9,6 +9,7 @@ import {
SessionEndReason,
SessionStartSource,
flushTelemetry,
resetBrowserSession,
} from '@google/gemini-cli-core';
import { CommandKind, type SlashCommand } from './types.js';
import { MessageType } from '../types.js';
@@ -43,6 +44,10 @@ export const clearCommand: SlashCommand = {
if (geminiClient) {
context.ui.setDebugMessage('Clearing terminal and resetting chat.');
// Close persistent browser sessions before resetting chat
await resetBrowserSession();
// If resetChat fails, the exception will propagate and halt the command,
// which is the correct behavior to signal a failure to the user.
await geminiClient.resetChat();