mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 03:24:42 -07:00
refactor(core): align JIT memory placement with tiered context model (#22766)
This commit is contained in:
@@ -57,11 +57,15 @@ export async function getEnvironmentContext(config: Config): Promise<Part[]> {
|
||||
? await getDirectoryContextString(config)
|
||||
: '';
|
||||
const tempDir = config.storage.getProjectTempDir();
|
||||
// When JIT context is enabled, project memory is already included in the
|
||||
// system instruction via renderUserMemory(). Skip it here to avoid sending
|
||||
// the same GEMINI.md content twice.
|
||||
// Tiered context model (see issue #11488):
|
||||
// - Tier 1 (global): system instruction only
|
||||
// - Tier 2 (extension + project): first user message (here)
|
||||
// - Tier 3 (subdirectory): tool output (JIT)
|
||||
// When JIT is enabled, Tier 2 memory is provided by getSessionMemory().
|
||||
// When JIT is disabled, all memory is in the system instruction and
|
||||
// getEnvironmentMemory() provides the project memory for this message.
|
||||
const environmentMemory = config.isJitContextEnabled?.()
|
||||
? ''
|
||||
? config.getSessionMemory()
|
||||
: config.getEnvironmentMemory();
|
||||
|
||||
const context = `
|
||||
|
||||
Reference in New Issue
Block a user