mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-07 11:51:14 -07:00
feat(core): enhanced anchored iterative context compression with self-verification (#15710)
This commit is contained in:
committed by
GitHub
parent
e34f0b4a98
commit
1182168bd9
@@ -211,4 +211,36 @@ describe('<CompressionMessage />', () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('failure states', () => {
|
||||
it('renders failure message when model returns an empty summary', () => {
|
||||
const props = createCompressionProps({
|
||||
isPending: false,
|
||||
compressionStatus: CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY,
|
||||
});
|
||||
const { lastFrame, unmount } = render(<CompressionMessage {...props} />);
|
||||
const output = lastFrame();
|
||||
|
||||
expect(output).toContain('✦');
|
||||
expect(output).toContain(
|
||||
'Chat history compression failed: the model returned an empty summary.',
|
||||
);
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('renders failure message for token count errors', () => {
|
||||
const props = createCompressionProps({
|
||||
isPending: false,
|
||||
compressionStatus:
|
||||
CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR,
|
||||
});
|
||||
const { lastFrame, unmount } = render(<CompressionMessage {...props} />);
|
||||
const output = lastFrame();
|
||||
|
||||
expect(output).toContain(
|
||||
'Could not compress chat history due to a token counting error.',
|
||||
);
|
||||
unmount();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -46,6 +46,8 @@ export function CompressionMessage({
|
||||
return 'Chat history compression did not reduce size. This may indicate issues with the compression prompt.';
|
||||
case CompressionStatus.COMPRESSION_FAILED_TOKEN_COUNT_ERROR:
|
||||
return 'Could not compress chat history due to a token counting error.';
|
||||
case CompressionStatus.COMPRESSION_FAILED_EMPTY_SUMMARY:
|
||||
return 'Chat history compression failed: the model returned an empty summary.';
|
||||
case CompressionStatus.NOOP:
|
||||
return 'Nothing to compress.';
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user