feat(admin): implement admin controls polling and restart prompt (#16627)

This commit is contained in:
Shreya Keshive
2026-01-16 15:24:53 -05:00
committed by GitHub
parent 93224e1813
commit d8d4d87e29
20 changed files with 689 additions and 26 deletions
+10 -2
View File
@@ -6,7 +6,10 @@
import { spawn } from 'node:child_process';
import { RELAUNCH_EXIT_CODE } from './processUtils.js';
import { writeToStderr } from '@google/gemini-cli-core';
import {
writeToStderr,
type FetchAdminControlsResponse,
} from '@google/gemini-cli-core';
export async function relaunchOnExitCode(runner: () => Promise<number>) {
while (true) {
@@ -31,6 +34,7 @@ export async function relaunchOnExitCode(runner: () => Promise<number>) {
export async function relaunchAppInChildProcess(
additionalNodeArgs: string[],
additionalScriptArgs: string[],
remoteAdminSettings?: FetchAdminControlsResponse,
) {
if (process.env['GEMINI_CLI_NO_RELAUNCH']) {
return;
@@ -55,10 +59,14 @@ export async function relaunchAppInChildProcess(
process.stdin.pause();
const child = spawn(process.execPath, nodeArgs, {
stdio: 'inherit',
stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
env: newEnv,
});
if (remoteAdminSettings) {
child.send({ type: 'admin-settings', settings: remoteAdminSettings });
}
return new Promise<number>((resolve, reject) => {
child.on('error', reject);
child.on('close', (code) => {