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.
This commit is contained in:
@@ -208,7 +208,7 @@ describe('dsh web keyless CLI smoke', () => {
|
|||||||
request.on('end', () => {
|
request.on('end', () => {
|
||||||
const parsed = JSON.parse(body) as NativeProviderRequest
|
const parsed = JSON.parse(body) as NativeProviderRequest
|
||||||
if ((parsed.tools?.length ?? 0) > 0) requests.push(parsed)
|
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.writeHead(200, { 'content-type': 'text/event-stream' })
|
||||||
response.end([
|
response.end([
|
||||||
'data: {"choices":[{"delta":{"role":"assistant","content":null,"reasoning_content":""}}]}',
|
'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()
|
setTimeout(() => { reject(new Error('provider request not received in 10s')) }, 10_000).unref()
|
||||||
}),
|
}),
|
||||||
])
|
])
|
||||||
const initial = capturedRequests[0]
|
const captured = capturedRequests[0]
|
||||||
const captured = capturedRequests[1]
|
if (captured === undefined) {
|
||||||
if (initial === undefined || captured === undefined) {
|
throw new Error('provider did not receive the workspace projection request')
|
||||||
throw new Error('provider did not receive both workspace projection requests')
|
|
||||||
}
|
}
|
||||||
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 =>
|
const workspaceMessage = captured.messages?.find(message =>
|
||||||
message.role === 'user' && message.content?.includes('web-workspace-context-probe'))
|
message.role === 'user' && message.content?.includes('web-workspace-context-probe'))
|
||||||
const systemMessage = captured.messages?.find(message => message.role === 'system')
|
const systemMessage = captured.messages?.find(message => message.role === 'system')
|
||||||
|
|||||||
Reference in New Issue
Block a user