mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
chore: simplify naming
This commit is contained in:
@@ -37,7 +37,7 @@ describe('processUtils', () => {
|
|||||||
expect(handleAutoUpdate.waitForUpdateCompletion).toHaveBeenCalledTimes(1);
|
expect(handleAutoUpdate.waitForUpdateCompletion).toHaveBeenCalledTimes(1);
|
||||||
expect(runExitCleanup).toHaveBeenCalledTimes(1);
|
expect(runExitCleanup).toHaveBeenCalledTimes(1);
|
||||||
expect(process.send).toHaveBeenCalledWith({
|
expect(process.send).toHaveBeenCalledWith({
|
||||||
type: 'relaunch-resume-session',
|
type: 'relaunch-session',
|
||||||
sessionId: expect.any(String),
|
sessionId: expect.any(String),
|
||||||
});
|
});
|
||||||
expect(processExit).toHaveBeenCalledWith(RELAUNCH_EXIT_CODE);
|
expect(processExit).toHaveBeenCalledWith(RELAUNCH_EXIT_CODE);
|
||||||
@@ -53,7 +53,7 @@ describe('processUtils', () => {
|
|||||||
expect(handleAutoUpdate.waitForUpdateCompletion).toHaveBeenCalledTimes(1);
|
expect(handleAutoUpdate.waitForUpdateCompletion).toHaveBeenCalledTimes(1);
|
||||||
expect(runExitCleanup).toHaveBeenCalledTimes(1);
|
expect(runExitCleanup).toHaveBeenCalledTimes(1);
|
||||||
expect(process.send).toHaveBeenCalledWith({
|
expect(process.send).toHaveBeenCalledWith({
|
||||||
type: 'relaunch-resume-session',
|
type: 'relaunch-session',
|
||||||
sessionId: 'custom-session-id',
|
sessionId: 'custom-session-id',
|
||||||
});
|
});
|
||||||
expect(processExit).toHaveBeenCalledWith(RELAUNCH_EXIT_CODE);
|
expect(processExit).toHaveBeenCalledWith(RELAUNCH_EXIT_CODE);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export async function relaunchApp(sessionIdOverride?: string): Promise<void> {
|
|||||||
|
|
||||||
if (process.send) {
|
if (process.send) {
|
||||||
process.send({
|
process.send({
|
||||||
type: 'relaunch-resume-session',
|
type: 'relaunch-session',
|
||||||
sessionId: sessionIdOverride ?? sessionId,
|
sessionId: sessionIdOverride ?? sessionId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ describe('relaunchAppInChildProcess', () => {
|
|||||||
expect(processExitSpy).toHaveBeenCalledWith(1);
|
expect(processExitSpy).toHaveBeenCalledWith(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should append --resume <sessionId> on the next spawn if relaunch-resume-session message is received', async () => {
|
it('should append --resume <sessionId> on the next spawn if relaunch-session message is received', async () => {
|
||||||
process.argv = ['/usr/bin/node', '/app/cli.js', '--some-flag'];
|
process.argv = ['/usr/bin/node', '/app/cli.js', '--some-flag'];
|
||||||
|
|
||||||
let spawnCount = 0;
|
let spawnCount = 0;
|
||||||
@@ -328,7 +328,7 @@ describe('relaunchAppInChildProcess', () => {
|
|||||||
// First run: send the resume session ID, then exit with RELAUNCH_EXIT_CODE
|
// First run: send the resume session ID, then exit with RELAUNCH_EXIT_CODE
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
mockChild.emit('message', {
|
mockChild.emit('message', {
|
||||||
type: 'relaunch-resume-session',
|
type: 'relaunch-session',
|
||||||
sessionId: 'test-session-123',
|
sessionId: 'test-session-123',
|
||||||
});
|
});
|
||||||
mockChild.emit('close', RELAUNCH_EXIT_CODE);
|
mockChild.emit('close', RELAUNCH_EXIT_CODE);
|
||||||
@@ -378,7 +378,7 @@ describe('relaunchAppInChildProcess', () => {
|
|||||||
if (spawnCount === 1) {
|
if (spawnCount === 1) {
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
mockChild.emit('message', {
|
mockChild.emit('message', {
|
||||||
type: 'relaunch-resume-session',
|
type: 'relaunch-session',
|
||||||
sessionId: 'new-session-456',
|
sessionId: 'new-session-456',
|
||||||
});
|
});
|
||||||
mockChild.emit('close', RELAUNCH_EXIT_CODE);
|
mockChild.emit('close', RELAUNCH_EXIT_CODE);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export async function relaunchAppInChildProcess(
|
|||||||
(msg: { type?: string; settings?: unknown; sessionId?: string }) => {
|
(msg: { type?: string; settings?: unknown; sessionId?: string }) => {
|
||||||
if (msg.type === 'admin-settings-update' && msg.settings) {
|
if (msg.type === 'admin-settings-update' && msg.settings) {
|
||||||
latestAdminSettings = msg.settings as AdminControlsSettings;
|
latestAdminSettings = msg.settings as AdminControlsSettings;
|
||||||
} else if (msg.type === 'relaunch-resume-session' && msg.sessionId) {
|
} else if (msg.type === 'relaunch-session' && msg.sessionId) {
|
||||||
resumeSessionId = msg.sessionId;
|
resumeSessionId = msg.sessionId;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user