refactor: maintain 1 GeminiChat per GeminiClient (#710)

This commit is contained in:
Brandon Keiji 2025-06-03 02:10:54 +00:00 committed by GitHub
parent 447826ab40
commit 74801e9004
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 26 additions and 46 deletions

View file

@ -39,7 +39,7 @@ describe('runNonInteractive', () => {
sendMessageStream: vi.fn(),
};
mockGeminiClient = {
startChat: vi.fn().mockResolvedValue(mockChat),
getChat: vi.fn().mockResolvedValue(mockChat),
} as unknown as GeminiClient;
mockToolRegistry = {
getFunctionDeclarations: vi.fn().mockReturnValue([]),
@ -80,7 +80,6 @@ describe('runNonInteractive', () => {
await runNonInteractive(mockConfig, 'Test input');
expect(mockGeminiClient.startChat).toHaveBeenCalled();
expect(mockChat.sendMessageStream).toHaveBeenCalledWith({
message: [{ text: 'Test input' }],
config: {