mirror of
https://github.com/google-gemini/gemini-cli
synced 2026-04-21 13:37:17 +00:00
speculative fix
This commit is contained in:
parent
6d7aa497aa
commit
05f0d862c1
4 changed files with 23 additions and 12 deletions
|
|
@ -88,24 +88,32 @@ export const generalistProfile: ContextProfile = {
|
|||
}),
|
||||
),
|
||||
createBlobDegradationProcessor('BlobDegradation', env), // No options
|
||||
// Automatically distill extremely large blocks (e.g. huge source files pasted by the user)
|
||||
createNodeDistillationProcessor(
|
||||
'ImmediateNodeDistillation',
|
||||
env,
|
||||
resolveProcessorOptions(config, 'ImmediateNodeDistillation', {
|
||||
nodeThresholdTokens: 15000,
|
||||
}),
|
||||
),
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Normalization',
|
||||
triggers: ['retained_exceeded'],
|
||||
processors: [
|
||||
createNodeTruncationProcessor(
|
||||
'NodeTruncation',
|
||||
env,
|
||||
resolveProcessorOptions(config, 'NodeTruncation', {
|
||||
maxTokensPerNode: 3000,
|
||||
}),
|
||||
),
|
||||
createNodeDistillationProcessor(
|
||||
'NodeDistillation',
|
||||
env,
|
||||
resolveProcessorOptions(config, 'NodeDistillation', {
|
||||
nodeThresholdTokens: 5000,
|
||||
nodeThresholdTokens: 3000,
|
||||
}),
|
||||
),
|
||||
createNodeTruncationProcessor(
|
||||
'NodeTruncation',
|
||||
env,
|
||||
resolveProcessorOptions(config, 'NodeTruncation', {
|
||||
maxTokensPerNode: 2000,
|
||||
}),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -129,7 +129,10 @@ export function createToolMaskingProcessor(
|
|||
1024
|
||||
).toFixed(2);
|
||||
const totalLines = content.split('\n').length;
|
||||
return `<tool_output_masked>\n[Tool ${nodeType} string (${fileSizeMB}MB, ${totalLines} lines) masked to preserve context window. Full string saved to: ${filePath}]\n</tool_output_masked>`;
|
||||
|
||||
// Ensure consistent path separators for LLM tokenization and deterministic tests across OSes
|
||||
const normalizedPath = filePath.split(path.sep).join('/');
|
||||
return `<tool_output_masked>\n[Tool ${nodeType} string (${fileSizeMB}MB, ${totalLines} lines) masked to preserve context window. Full string saved to: ${normalizedPath}]\n</tool_output_masked>`;
|
||||
};
|
||||
|
||||
const returnedNodes: ConcreteNode[] = [];
|
||||
|
|
|
|||
|
|
@ -43,12 +43,12 @@ exports[`System Lifecycle Golden Tests > Scenario 1: Organic Growth with Huge To
|
|||
"turnIndex": 1,
|
||||
},
|
||||
{
|
||||
"tokensAfterBackground": 436,
|
||||
"tokensAfterBackground": 440,
|
||||
"tokensBeforeBackground": 20148,
|
||||
"turnIndex": 2,
|
||||
},
|
||||
{
|
||||
"tokensAfterBackground": 61,
|
||||
"tokensAfterBackground": 62,
|
||||
"tokensBeforeBackground": 3017,
|
||||
"turnIndex": 3,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export class SimulationHarness {
|
|||
static async create(
|
||||
config: ContextProfile,
|
||||
mockLlmClient: BaseLlmClient,
|
||||
mockTempDir = '/tmp/sim',
|
||||
mockTempDir = 'mock/sim/dir',
|
||||
): Promise<SimulationHarness> {
|
||||
const harness = new SimulationHarness();
|
||||
await harness.init(config, mockLlmClient, mockTempDir);
|
||||
|
|
|
|||
Loading…
Reference in a new issue