Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions packages/core/src/core/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,34 +652,6 @@ describe('Gemini Client (client.ts)', () => {
});
});

it('attempts to compress with a maxOutputTokens set to the original token count', async () => {
vi.mocked(tokenLimit).mockReturnValue(1000);
vi.mocked(mockContentGenerator.countTokens).mockResolvedValue({
totalTokens: 999,
});

mockGetHistory.mockReturnValue([
{ role: 'user', parts: [{ text: '...history...' }] },
]);

// Mock the summary response from the chat
mockSendMessage.mockResolvedValue({
role: 'model',
parts: [{ text: 'This is a summary.' }],
});

await client.tryCompressChat('prompt-id-2', true);

expect(mockSendMessage).toHaveBeenCalledWith(
expect.objectContaining({
config: expect.objectContaining({
maxOutputTokens: 999,
}),
}),
'prompt-id-2',
);
});

it('should not trigger summarization if token count is below threshold', async () => {
const MOCKED_TOKEN_LIMIT = 1000;
vi.mocked(tokenLimit).mockReturnValue(MOCKED_TOKEN_LIMIT);
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/core/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,6 @@ export class GeminiClient {
},
config: {
systemInstruction: { text: getCompressionPrompt() },
maxOutputTokens: originalTokenCount,
},
},
prompt_id,
Expand Down
Loading