From b54d1c5c9988786f27c03a42da75e9c5beed2d43 Mon Sep 17 00:00:00 2001 From: _Kerman Date: Wed, 5 Aug 2026 16:13:03 +0800 Subject: [PATCH] test(web): pin the single-request workspace projection in the dev smoke The react-loop simplification folds the workspace baseline into the first entering request, so the --dev CLI smoke no longer sees a workspace-free probe request before the projected one. Resolve on the first provider request and drop the obsolete no-workspace initial assertions. --- apps/web/tests/smoke-real.e2e.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/apps/web/tests/smoke-real.e2e.ts b/apps/web/tests/smoke-real.e2e.ts index eba4cc7ee9..03faab05cd 100644 --- a/apps/web/tests/smoke-real.e2e.ts +++ b/apps/web/tests/smoke-real.e2e.ts @@ -208,7 +208,7 @@ describe('dsh web keyless CLI smoke', () => { request.on('end', () => { const parsed = JSON.parse(body) as NativeProviderRequest if ((parsed.tools?.length ?? 0) > 0) requests.push(parsed) - if (requests.length === 2) resolveProviderRequests(requests) + if (requests.length === 1) resolveProviderRequests(requests) response.writeHead(200, { 'content-type': 'text/event-stream' }) response.end([ 'data: {"choices":[{"delta":{"role":"assistant","content":null,"reasoning_content":""}}]}', @@ -253,15 +253,10 @@ describe('dsh web keyless CLI smoke', () => { setTimeout(() => { reject(new Error('provider request not received in 10s')) }, 10_000).unref() }), ]) - const initial = capturedRequests[0] - const captured = capturedRequests[1] - if (initial === undefined || captured === undefined) { - throw new Error('provider did not receive both workspace projection requests') + const captured = capturedRequests[0] + if (captured === undefined) { + throw new Error('provider did not receive the workspace projection request') } - expect(initial.messages?.some(message => - message.role === 'user' && message.content?.includes(''))).toBe(false) - expect(initial.messages?.some(message => - message.role === 'user' && message.content?.includes('web-workspace-context-probe'))).toBe(false) const workspaceMessage = captured.messages?.find(message => message.role === 'user' && message.content?.includes('web-workspace-context-probe')) const systemMessage = captured.messages?.find(message => message.role === 'system')