diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts index d3b73e06..9731b503 100644 --- a/packages/cli/src/config/config.ts +++ b/packages/cli/src/config/config.ts @@ -229,6 +229,7 @@ export async function parseArguments(): Promise { // Handle comma-separated values dirs.flatMap((dir) => dir.split(',').map((d) => d.trim())), }) + .check((argv) => { if (argv.prompt && argv['promptInteractive']) { throw new Error( @@ -540,6 +541,7 @@ export async function loadCliConfig( interactive, trustedFolder, shouldUseNodePtyShell: settings.shouldUseNodePtyShell, + skipNextSpeakerCheck: settings.skipNextSpeakerCheck, }); } diff --git a/packages/cli/src/config/settingsSchema.ts b/packages/cli/src/config/settingsSchema.ts index 8c1b5191..6d9e1f1e 100644 --- a/packages/cli/src/config/settingsSchema.ts +++ b/packages/cli/src/config/settingsSchema.ts @@ -515,6 +515,15 @@ export const SETTINGS_SCHEMA = { description: 'Show line numbers in the chat.', showInDialog: true, }, + skipNextSpeakerCheck: { + type: 'boolean', + label: 'Skip Next Speaker Check', + category: 'General', + requiresRestart: false, + default: false, + description: 'Skip the next speaker check.', + showInDialog: true, + }, } as const; type InferSettings = { diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index 8c95a99d..6a8e6d4b 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -203,6 +203,7 @@ export interface ConfigParameters { interactive?: boolean; trustedFolder?: boolean; shouldUseNodePtyShell?: boolean; + skipNextSpeakerCheck?: boolean; } export class Config { @@ -269,6 +270,7 @@ export class Config { private readonly interactive: boolean; private readonly trustedFolder: boolean | undefined; private readonly shouldUseNodePtyShell: boolean; + private readonly skipNextSpeakerCheck: boolean; private initialized: boolean = false; constructor(params: ConfigParameters) { @@ -337,6 +339,7 @@ export class Config { this.interactive = params.interactive ?? false; this.trustedFolder = params.trustedFolder; this.shouldUseNodePtyShell = params.shouldUseNodePtyShell ?? false; + this.skipNextSpeakerCheck = params.skipNextSpeakerCheck ?? false; if (params.contextFileName) { setGeminiMdFilename(params.contextFileName); @@ -735,6 +738,10 @@ export class Config { return this.shouldUseNodePtyShell; } + getSkipNextSpeakerCheck(): boolean { + return this.skipNextSpeakerCheck; + } + async getGitService(): Promise { if (!this.gitService) { this.gitService = new GitService(this.targetDir); diff --git a/packages/core/src/core/client.test.ts b/packages/core/src/core/client.test.ts index 8e219f3c..5e3f8eb7 100644 --- a/packages/core/src/core/client.test.ts +++ b/packages/core/src/core/client.test.ts @@ -209,6 +209,7 @@ describe('Gemini Client (client.ts)', () => { getGeminiClient: vi.fn(), setFallbackMode: vi.fn(), getChatCompression: vi.fn().mockReturnValue(undefined), + getSkipNextSpeakerCheck: vi.fn().mockReturnValue(false), }; const MockedConfig = vi.mocked(Config, true); MockedConfig.mockImplementation( diff --git a/packages/core/src/core/client.ts b/packages/core/src/core/client.ts index a77a4893..d521ab18 100644 --- a/packages/core/src/core/client.ts +++ b/packages/core/src/core/client.ts @@ -527,6 +527,10 @@ export class GeminiClient { return turn; } + if (this.config.getSkipNextSpeakerCheck()) { + return turn; + } + const nextSpeakerCheck = await checkNextSpeaker( this.getChat(), this,