test(scaffold-server): expect absent lastAssistantMessage for a childless result
The subagent/end edge now encodes 'no output' as an absent field, never an empty array; the wire projection forwards only present fields.
This commit is contained in:
@@ -106,6 +106,8 @@ describe.skipIf(!existsSync(jsonrpcBundle))('dsh-jsonrpc BUILT scope carrier', (
|
|||||||
})
|
})
|
||||||
|
|
||||||
expect(stderr).not.toContain('listener threw')
|
expect(stderr).not.toContain('listener threw')
|
||||||
|
// A childless result carries NO lastAssistantMessage on the wire: the end
|
||||||
|
// edge encodes "no output" as an absent field, never `[]`.
|
||||||
expect(JSON.parse(stdout) as unknown).toEqual([{
|
expect(JSON.parse(stdout) as unknown).toEqual([{
|
||||||
method: 'subagent.finished',
|
method: 'subagent.finished',
|
||||||
params: {
|
params: {
|
||||||
@@ -115,7 +117,6 @@ describe.skipIf(!existsSync(jsonrpcBundle))('dsh-jsonrpc BUILT scope carrier', (
|
|||||||
childSessionId: 'built-child',
|
childSessionId: 'built-child',
|
||||||
status: 'ok',
|
status: 'ok',
|
||||||
stopReason: 'completed',
|
stopReason: 'completed',
|
||||||
lastAssistantMessage: [],
|
|
||||||
},
|
},
|
||||||
}])
|
}])
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -736,6 +736,8 @@ describe('HarnessSdkServer', () => {
|
|||||||
stopReason: 'error',
|
stopReason: 'error',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// A childless result carries NO lastAssistantMessage on the wire: the
|
||||||
|
// end edge encodes "no output" as an absent field, never `[]`.
|
||||||
expect(transport.notifications).toContainEqual({
|
expect(transport.notifications).toContainEqual({
|
||||||
method: 'subagent.finished',
|
method: 'subagent.finished',
|
||||||
params: {
|
params: {
|
||||||
@@ -745,7 +747,6 @@ describe('HarnessSdkServer', () => {
|
|||||||
childSessionId: 'fallback-child-session',
|
childSessionId: 'fallback-child-session',
|
||||||
status: 'ok',
|
status: 'ok',
|
||||||
stopReason: 'max-tokens',
|
stopReason: 'max-tokens',
|
||||||
lastAssistantMessage: [],
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
expect(transport.notifications).toContainEqual({
|
expect(transport.notifications).toContainEqual({
|
||||||
|
|||||||
Reference in New Issue
Block a user