File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,21 @@ describe('Client E2E tests', () => {
202202
203203 expect ( removeUndefinedFields ( actual ) ) . to . deep . equal ( expected ) ;
204204 } ) ;
205+
206+ it ( 'should fallback to non-streaming sendMessage if agent does not support streaming' , async ( ) => {
207+ agentCard . capabilities . streaming = false ;
208+ const expected = createTestMessage ( '1' , 'fallback-test' ) ;
209+ agentExecutor . events = [ expected ] ;
210+ const client = await clientFactory . createFromAgentCard ( agentCard ) ;
211+
212+ const actual : A2AStreamEventData [ ] = [ ] ;
213+ for await ( const message of client . sendMessageStream ( { message : expected } ) ) {
214+ actual . push ( message ) ;
215+ }
216+
217+ expect ( actual ) . to . have . lengthOf ( 1 ) ;
218+ expect ( removeUndefinedFields ( actual [ 0 ] ) ) . to . deep . equal ( expected ) ;
219+ } ) ;
205220 } ) ;
206221 } ) ;
207222 } ) ;
You can’t perform that action at this time.
0 commit comments