mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
Add a context percentage threshold setting for auto compression (#5721)
This commit is contained in:
parent
36750ca49b
commit
6ae75c9f32
8 changed files with 219 additions and 7 deletions
|
|
@ -69,6 +69,10 @@ export interface BugCommandSettings {
|
|||
urlTemplate: string;
|
||||
}
|
||||
|
||||
export interface ChatCompressionSettings {
|
||||
contextPercentageThreshold?: number;
|
||||
}
|
||||
|
||||
export interface SummarizeToolOutputSettings {
|
||||
tokenBudget?: number;
|
||||
}
|
||||
|
|
@ -191,6 +195,7 @@ export interface ConfigParameters {
|
|||
folderTrustFeature?: boolean;
|
||||
ideMode?: boolean;
|
||||
loadMemoryFromIncludeDirectories?: boolean;
|
||||
chatCompression?: ChatCompressionSettings;
|
||||
}
|
||||
|
||||
export class Config {
|
||||
|
|
@ -252,6 +257,7 @@ export class Config {
|
|||
| undefined;
|
||||
private readonly experimentalAcp: boolean = false;
|
||||
private readonly loadMemoryFromIncludeDirectories: boolean = false;
|
||||
private readonly chatCompression: ChatCompressionSettings | undefined;
|
||||
|
||||
constructor(params: ConfigParameters) {
|
||||
this.sessionId = params.sessionId;
|
||||
|
|
@ -316,6 +322,7 @@ export class Config {
|
|||
}
|
||||
this.loadMemoryFromIncludeDirectories =
|
||||
params.loadMemoryFromIncludeDirectories ?? false;
|
||||
this.chatCompression = params.chatCompression;
|
||||
|
||||
if (params.contextFileName) {
|
||||
setGeminiMdFilename(params.contextFileName);
|
||||
|
|
@ -667,6 +674,10 @@ export class Config {
|
|||
return this.ideClient;
|
||||
}
|
||||
|
||||
getChatCompression(): ChatCompressionSettings | undefined {
|
||||
return this.chatCompression;
|
||||
}
|
||||
|
||||
async getGitService(): Promise<GitService> {
|
||||
if (!this.gitService) {
|
||||
this.gitService = new GitService(this.targetDir);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue