fix(core): remove "System: Please continue." injection on InvalidStream events (#26340)

This commit is contained in:
Sandy Tao
2026-05-01 12:45:31 -07:00
committed by GitHub
parent 363854172f
commit 9380e13f6d
14 changed files with 53 additions and 298 deletions
@@ -263,7 +263,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-1',
undefined,
false,
'Test input',
);
expect(getWrittenOutput()).toBe('Hello World\n');
@@ -382,7 +381,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-2',
undefined,
false,
undefined,
);
expect(getWrittenOutput()).toBe('Final answer\n');
@@ -542,7 +540,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-3',
undefined,
false,
undefined,
);
expect(getWrittenOutput()).toBe('Sorry, let me try again.\n');
@@ -684,7 +681,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-7',
undefined,
false,
rawInput,
);
@@ -720,7 +716,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-1',
undefined,
false,
'Test input',
);
expect(processStdoutSpy).toHaveBeenCalledWith(
@@ -853,7 +848,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-empty',
undefined,
false,
'Empty response test',
);
@@ -990,7 +984,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-slash',
undefined,
false,
'/testcommand',
);
@@ -1036,7 +1029,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-slash',
undefined,
false,
'/help',
);
expect(getWrittenOutput()).toBe('Response to slash command\n');
@@ -1214,7 +1206,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-unknown',
undefined,
false,
'/unknowncommand',
);
-1
View File
@@ -319,7 +319,6 @@ export async function runNonInteractive(
abortController.signal,
prompt_id,
undefined,
false,
turnCount === 1 ? input : undefined,
);
@@ -269,7 +269,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-1',
undefined,
false,
'Test input',
);
expect(getWrittenOutput()).toBe('Hello World\n');
@@ -436,7 +435,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-2',
undefined,
false,
undefined,
);
expect(getWrittenOutput()).toBe('Final answer\n');
@@ -596,7 +594,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-3',
undefined,
false,
undefined,
);
expect(getWrittenOutput()).toBe('Sorry, let me try again.\n');
@@ -738,7 +735,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-7',
undefined,
false,
rawInput,
);
@@ -774,7 +770,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-1',
undefined,
false,
'Test input',
);
expect(processStdoutSpy).toHaveBeenCalledWith(
@@ -980,7 +975,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-empty',
undefined,
false,
'Empty response test',
);
@@ -1117,7 +1111,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-slash',
undefined,
false,
'/testcommand',
);
@@ -1163,7 +1156,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-slash',
undefined,
false,
'/help',
);
expect(getWrittenOutput()).toBe('Response to slash command\n');
@@ -1383,7 +1375,6 @@ describe('runNonInteractive', () => {
expect.any(AbortSignal),
'prompt-id-unknown',
undefined,
false,
'/unknowncommand',
);
@@ -135,7 +135,6 @@ export const createMockConfig = (overrides: Partial<Config> = {}): Config =>
getUseRipgrep: vi.fn().mockReturnValue(false),
getEnableInteractiveShell: vi.fn().mockReturnValue(false),
getSkipNextSpeakerCheck: vi.fn().mockReturnValue(false),
getContinueOnFailedApiCall: vi.fn().mockReturnValue(false),
getRetryFetchErrors: vi.fn().mockReturnValue(true),
getEnableShellOutputEfficiency: vi.fn().mockReturnValue(true),
getShellToolInactivityTimeout: vi.fn().mockReturnValue(300000),
@@ -805,7 +805,6 @@ describe('useGeminiStream', () => {
expect.any(AbortSignal),
'prompt-id-2',
undefined,
false,
expectedMergedResponse,
);
});
@@ -1532,7 +1531,6 @@ describe('useGeminiStream', () => {
expect.any(AbortSignal),
'prompt-id-4',
undefined,
false,
toolCallResponseParts,
);
});
@@ -2027,7 +2025,6 @@ describe('useGeminiStream', () => {
expect.any(AbortSignal),
expect.any(String),
undefined,
false,
'/my-custom-command',
);
@@ -2056,7 +2053,6 @@ describe('useGeminiStream', () => {
expect.any(AbortSignal),
expect.any(String),
undefined,
false,
'/emptycmd',
);
});
@@ -2077,7 +2073,6 @@ describe('useGeminiStream', () => {
expect.any(AbortSignal),
expect.any(String),
undefined,
false,
'// This is a line comment',
);
});
@@ -2098,7 +2093,6 @@ describe('useGeminiStream', () => {
expect.any(AbortSignal),
expect.any(String),
undefined,
false,
'/* This is a block comment */',
);
});
@@ -3058,7 +3052,6 @@ describe('useGeminiStream', () => {
expect.any(AbortSignal), // Argument 2: An AbortSignal
expect.any(String), // Argument 3: The prompt_id string
undefined,
false,
rawQuery,
);
});
@@ -3709,7 +3702,6 @@ describe('useGeminiStream', () => {
expect.any(AbortSignal),
expect.any(String),
undefined,
false,
'test query',
);
});
@@ -3859,7 +3851,6 @@ describe('useGeminiStream', () => {
expect.any(AbortSignal),
expect.any(String),
undefined,
false,
'second query',
);
});
@@ -4004,7 +3995,6 @@ describe('useGeminiStream', () => {
expect.any(AbortSignal),
expect.any(String),
undefined,
false,
'test query',
);
});
@@ -1670,7 +1670,6 @@ export const useGeminiStream = (
abortSignal,
prompt_id!,
undefined,
false,
query,
);
const processingStatus = await processGeminiStreamEvents(