mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-13 07:30:52 -07:00
feat(core): increase context compression preservation
COMPRESSION_PRESERVE_THRESHOLD 0.3→0.4, FUNCTION_RESPONSE_TOKEN_BUDGET 50k→75k to retain more context for incremental tasks.
This commit is contained in:
@@ -718,8 +718,9 @@ describe('ChatCompressionService', () => {
|
||||
|
||||
it('should use high-fidelity original history for summarization when under the limit, but truncated version for active window', async () => {
|
||||
// Large response in the "to compress" section (first message)
|
||||
// 300,000 chars is ~75k tokens, well under the 1,000,000 summarizer limit.
|
||||
const massiveText = 'a'.repeat(300000);
|
||||
// 500,000 chars is ~125k tokens, well under the 1,000,000 summarizer limit
|
||||
// but exceeds COMPRESSION_FUNCTION_RESPONSE_TOKEN_BUDGET (75k).
|
||||
const massiveText = 'a'.repeat(500000);
|
||||
const history: Content[] = [
|
||||
{
|
||||
role: 'user',
|
||||
|
||||
@@ -43,12 +43,12 @@ const DEFAULT_COMPRESSION_TOKEN_THRESHOLD = 0.5;
|
||||
* The fraction of the latest chat history to keep. A value of 0.3
|
||||
* means that only the last 30% of the chat history will be kept after compression.
|
||||
*/
|
||||
const COMPRESSION_PRESERVE_THRESHOLD = 0.3;
|
||||
const COMPRESSION_PRESERVE_THRESHOLD = 0.4;
|
||||
|
||||
/**
|
||||
* The budget for function response tokens in the preserved history.
|
||||
*/
|
||||
const COMPRESSION_FUNCTION_RESPONSE_TOKEN_BUDGET = 50_000;
|
||||
const COMPRESSION_FUNCTION_RESPONSE_TOKEN_BUDGET = 75_000;
|
||||
|
||||
/**
|
||||
* Returns the index of the oldest item to keep when compressing. May return
|
||||
|
||||
Reference in New Issue
Block a user