Explorar o código

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.
_Kerman hai 2 meses
pai
achega
b54d1c5c99
Modificáronse 1 ficheiros con 4 adicións e 9 borrados
  1. 4 9
      apps/web/tests/smoke-real.e2e.ts

+ 4 - 9
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('<available_skills>'))).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')