mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 05:42:54 -07:00
refactor(acp): delegate prompt turn processing logic to GeminiClient (#26222)
This commit is contained in:
@@ -3988,7 +3988,7 @@ describe('loadCliConfig acpMode and clientName', () => {
|
||||
expect(config.getClientName()).toBe('acp-vscode');
|
||||
});
|
||||
|
||||
it('should set acpMode to true but leave clientName undefined for generic terminals', async () => {
|
||||
it('should set acpMode to true and set clientName to acp for generic terminals', async () => {
|
||||
process.argv = ['node', 'script.js', '--acp'];
|
||||
vi.stubEnv('TERM_PROGRAM', 'iTerm.app'); // Generic terminal
|
||||
vi.stubEnv('VSCODE_GIT_ASKPASS_MAIN', '');
|
||||
@@ -4000,10 +4000,10 @@ describe('loadCliConfig acpMode and clientName', () => {
|
||||
argv,
|
||||
);
|
||||
expect(config.getAcpMode()).toBe(true);
|
||||
expect(config.getClientName()).toBeUndefined();
|
||||
expect(config.getClientName()).toBe('acp');
|
||||
});
|
||||
|
||||
it('should set acpMode to false and clientName to undefined by default', async () => {
|
||||
it('should set acpMode to false and clientName to tui by default', async () => {
|
||||
process.argv = ['node', 'script.js'];
|
||||
const argv = await parseArguments(createTestMergedSettings());
|
||||
const config = await loadCliConfig(
|
||||
@@ -4012,6 +4012,6 @@ describe('loadCliConfig acpMode and clientName', () => {
|
||||
argv,
|
||||
);
|
||||
expect(config.getAcpMode()).toBe(false);
|
||||
expect(config.getClientName()).toBeUndefined();
|
||||
expect(config.getClientName()).toBe('tui');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -931,7 +931,13 @@ export async function loadCliConfig(
|
||||
(ide.name !== 'vscode' || process.env['TERM_PROGRAM'] === 'vscode')
|
||||
) {
|
||||
clientName = `acp-${ide.name}`;
|
||||
} else {
|
||||
clientName = 'acp';
|
||||
}
|
||||
} else if (argv.isCommand) {
|
||||
clientName = 'cli-command';
|
||||
} else {
|
||||
clientName = 'tui';
|
||||
}
|
||||
|
||||
// TODO(joshualitt): Clean this up alongside removal of the legacy config.
|
||||
|
||||
Reference in New Issue
Block a user