From 98c043bf50a969d8d4b4d46fff4878149a9c9a0e Mon Sep 17 00:00:00 2001 From: xuewenjie Date: Mon, 29 Dec 2025 11:37:54 +0800 Subject: [PATCH] test: update tests for detached process changes --- .../services/shellExecutionService.test.ts | 2 +- packages/core/src/tools/shell.test.ts | 27 ------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/packages/core/src/services/shellExecutionService.test.ts b/packages/core/src/services/shellExecutionService.test.ts index c5a6e0776..e63fba28d 100644 --- a/packages/core/src/services/shellExecutionService.test.ts +++ b/packages/core/src/services/shellExecutionService.test.ts @@ -829,7 +829,7 @@ describe('ShellExecutionService child_process fallback', () => { [], expect.objectContaining({ shell: true, - detached: false, + detached: true, }), ); }); diff --git a/packages/core/src/tools/shell.test.ts b/packages/core/src/tools/shell.test.ts index eb8a17418..8db33b563 100644 --- a/packages/core/src/tools/shell.test.ts +++ b/packages/core/src/tools/shell.test.ts @@ -960,32 +960,5 @@ spanning multiple lines"`; {}, ); }); - - it('should detect immediate failure in Windows background task', async () => { - vi.mocked(os.platform).mockReturnValue('win32'); - const mockAbortSignal = new AbortController().signal; - - const invocation = shellTool.build({ - command: 'invalid_command', - is_background: true, - }); - - const promise = invocation.execute(mockAbortSignal); - - // Wait a tick to ensure mockShellOutputCallback is assigned - await new Promise((resolve) => setTimeout(resolve, 0)); - - if (mockShellOutputCallback) { - mockShellOutputCallback({ - type: 'data', - chunk: - "'invalid_command' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n", - }); - } - - const result = await promise; - expect(result.error).toBeDefined(); - expect(result.llmContent).toContain('Command failed to start'); - }); }); });