Skip to content

Commit e9a439a

Browse files
committed
feat: add repository context caching system for improved LLM performance
- Implement RepositoryContextManager to maintain complete project context - Add configuration options for context management (enabled, maxFiles, includeFileContent, etc.) - Integrate cached context into environment details sent to LLM - Update system prompt to mention repository context feature - Add comprehensive test suite for RepositoryContextManager - Automatically update context on file changes with debouncing - Support smart file selection based on relevance and patterns - Extract code patterns (imports, definitions, APIs) for better context understanding This addresses issue #7735 by providing a complete and updated repository context for every LLM call, improving accuracy and reducing token consumption.
1 parent e8deedd commit e9a439a

File tree

7 files changed

+840
-1
lines changed

7 files changed

+840
-1
lines changed

packages/types/src/global-settings.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,19 @@ export const globalSettingsSchema = z.object({
152152
hasOpenedModeSelector: z.boolean().optional(),
153153
lastModeExportPath: z.string().optional(),
154154
lastModeImportPath: z.string().optional(),
155+
156+
// Repository context configuration
157+
repositoryContext: z
158+
.object({
159+
enabled: z.boolean(),
160+
maxFileSize: z.number(),
161+
maxFiles: z.number(),
162+
includeFileContent: z.boolean(),
163+
excludePatterns: z.array(z.string()),
164+
updateInterval: z.number(),
165+
smartSelection: z.boolean(),
166+
})
167+
.optional(),
155168
})
156169

157170
export type GlobalSettings = z.infer<typeof globalSettingsSchema>

0 commit comments

Comments
 (0)