refactor(core,cli): useAlternateBuffer read from config (#20346)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
Pyush Sinha
2026-02-27 07:55:02 -08:00
committed by GitHub
parent 25ade7bcb7
commit d7320f5425
15 changed files with 164 additions and 41 deletions
+25
View File
@@ -941,6 +941,31 @@ describe('Server Config (config.ts)', () => {
});
});
describe('UseAlternateBuffer Configuration', () => {
it('should default useAlternateBuffer to false when not provided', () => {
const config = new Config(baseParams);
expect(config.getUseAlternateBuffer()).toBe(false);
});
it('should set useAlternateBuffer to true when provided as true', () => {
const paramsWithAlternateBuffer: ConfigParameters = {
...baseParams,
useAlternateBuffer: true,
};
const config = new Config(paramsWithAlternateBuffer);
expect(config.getUseAlternateBuffer()).toBe(true);
});
it('should set useAlternateBuffer to false when explicitly provided as false', () => {
const paramsWithAlternateBuffer: ConfigParameters = {
...baseParams,
useAlternateBuffer: false,
};
const config = new Config(paramsWithAlternateBuffer);
expect(config.getUseAlternateBuffer()).toBe(false);
});
});
describe('UseWriteTodos Configuration', () => {
it('should default useWriteTodos to true when not provided', () => {
const config = new Config(baseParams);
+7
View File
@@ -519,6 +519,7 @@ export interface ConfigParameters {
interactive?: boolean;
trustedFolder?: boolean;
useBackgroundColor?: boolean;
useAlternateBuffer?: boolean;
useRipgrep?: boolean;
enableInteractiveShell?: boolean;
skipNextSpeakerCheck?: boolean;
@@ -702,6 +703,7 @@ export class Config {
private readonly enableInteractiveShell: boolean;
private readonly skipNextSpeakerCheck: boolean;
private readonly useBackgroundColor: boolean;
private readonly useAlternateBuffer: boolean;
private shellExecutionConfig: ShellExecutionConfig;
private readonly extensionManagement: boolean = true;
private readonly truncateToolOutputThreshold: number;
@@ -900,6 +902,7 @@ export class Config {
this.directWebFetch = params.directWebFetch ?? false;
this.useRipgrep = params.useRipgrep ?? true;
this.useBackgroundColor = params.useBackgroundColor ?? true;
this.useAlternateBuffer = params.useAlternateBuffer ?? false;
this.enableInteractiveShell = params.enableInteractiveShell ?? false;
this.skipNextSpeakerCheck = params.skipNextSpeakerCheck ?? true;
this.shellExecutionConfig = {
@@ -2521,6 +2524,10 @@ export class Config {
return this.useBackgroundColor;
}
getUseAlternateBuffer(): boolean {
return this.useAlternateBuffer;
}
getEnableInteractiveShell(): boolean {
return this.enableInteractiveShell;
}