File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
sdk/ai/Azure.AI.Agents.Persistent Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1111### Breaking Changes
1212
1313### Bugs Fixed
14+ - Fix handling of streaming update of unexpected type [ issue] ( https://github.com/Azure/azure-sdk-for-net/issues/52407 ) .
1415
1516### Other Changes
1617
Original file line number Diff line number Diff line change @@ -212,8 +212,13 @@ async ValueTask<bool> IAsyncEnumerator<StreamingUpdate>.MoveNextAsync()
212212 return false ;
213213 }
214214
215- var updates = StreamingUpdate . FromEvent ( _events . Current ) ;
216- _updates = updates . GetEnumerator ( ) ;
215+ IEnumerable < StreamingUpdate > updates = StreamingUpdate . FromEvent ( _events . Current ) ;
216+ if ( updates is null )
217+ {
218+ StreamingUpdateReason updateKind = StreamingUpdateReasonExtensions . FromSseEventLabel ( _events . Current . EventType ) ;
219+ throw new InvalidOperationException ( $ "Unknown streaming update reason { updateKind } ") ;
220+ }
221+ _updates = updates . GetEnumerator ( ) ;
217222
218223 if ( _updates . MoveNext ( ) )
219224 {
Original file line number Diff line number Diff line change @@ -204,7 +204,12 @@ public bool MoveNext()
204204 return false ;
205205 }
206206
207- var updates = StreamingUpdate . FromEvent ( _events . Current ) ;
207+ IEnumerable < StreamingUpdate > updates = StreamingUpdate . FromEvent ( _events . Current ) ;
208+ if ( updates is null )
209+ {
210+ StreamingUpdateReason updateKind = StreamingUpdateReasonExtensions . FromSseEventLabel ( _events . Current . EventType ) ;
211+ throw new InvalidOperationException ( $ "Unknown streaming update reason { updateKind } ") ;
212+ }
208213 _updates = updates . GetEnumerator ( ) ;
209214
210215 if ( _updates . MoveNext ( ) )
You can’t perform that action at this time.
0 commit comments