From 6795567d28e61e03aa033d17f1c7922fc48f90ec Mon Sep 17 00:00:00 2001 From: Adam Weidman Date: Mon, 23 Mar 2026 11:00:04 -0400 Subject: [PATCH] fix(cli): align non-interactive loop warning handling --- packages/cli/src/nonInteractiveCli.test.ts | 2 +- packages/cli/src/nonInteractiveCli.ts | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/cli/src/nonInteractiveCli.test.ts b/packages/cli/src/nonInteractiveCli.test.ts index 15b51d188c..ade6275b2a 100644 --- a/packages/cli/src/nonInteractiveCli.test.ts +++ b/packages/cli/src/nonInteractiveCli.test.ts @@ -2388,7 +2388,7 @@ describe('runNonInteractive', () => { ); }); - it('should emit warning event for loop_detected custom event in streaming JSON mode', async () => { + it('should emit warning event for loop_detected in streaming JSON mode', async () => { vi.mocked(mockConfig.getOutputFormat).mockReturnValue( OutputFormat.STREAM_JSON, ); diff --git a/packages/cli/src/nonInteractiveCli.ts b/packages/cli/src/nonInteractiveCli.ts index 557ce3577c..3eb17d507f 100644 --- a/packages/cli/src/nonInteractiveCli.ts +++ b/packages/cli/src/nonInteractiveCli.ts @@ -538,19 +538,6 @@ export async function runNonInteractive({ streamEnded = true; break; } - case 'custom': { - if (event.kind === 'loop_detected') { - if (streamFormatter) { - streamFormatter.emitEvent({ - type: JsonStreamEventType.ERROR, - timestamp: new Date().toISOString(), - severity: 'warning', - message: 'Loop detected, stopping execution', - }); - } - } - break; - } default: break; }