This commit is contained in:
koalazf.99
2025-09-16 13:57:28 +08:00
parent 49d7947028
commit 740768dc1b

View File

@@ -12,6 +12,7 @@ import {
isTelemetrySdkInitialized, isTelemetrySdkInitialized,
GeminiEventType, GeminiEventType,
parseAndFormatApiError, parseAndFormatApiError,
ApprovalMode,
} from '@qwen-code/qwen-code-core'; } from '@qwen-code/qwen-code-core';
import { Content, Part, FunctionCall } from '@google/genai'; import { Content, Part, FunctionCall } from '@google/genai';
@@ -39,6 +40,12 @@ export async function runNonInteractive(
const geminiClient = config.getGeminiClient(); const geminiClient = config.getGeminiClient();
// In YOLO mode, disable next_speaker check to avoid auto-continue.
if (config.getApprovalMode && config.getApprovalMode() === ApprovalMode.YOLO) {
(config as unknown as { getSkipNextSpeakerCheck: () => boolean }).getSkipNextSpeakerCheck =
() => true;
}
const abortController = new AbortController(); const abortController = new AbortController();
let currentMessages: Content[] = [ let currentMessages: Content[] = [
{ role: 'user', parts: [{ text: input }] }, { role: 'user', parts: [{ text: input }] },