Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,11 @@ public async Task SendAsync_ConversationItemWithToolResult_SendsToolResult()
role: ChatRole.Tool);

await session.SendAsync(new CreateConversationItemRealtimeClientMessage(item), cancellationToken: TestContext.Current.CancellationToken);
// Wait for the toolResult AND its trailing contentEnd. The events are drained
// asynchronously by the background writer, so waiting only for toolResult races
// the later contentEnd assertion below.
WaitForEvent(capturedEvents, e => e.Contains("\"toolResult\""));
WaitForEvent(capturedEvents, e => e.Contains("\"contentEnd\""));

lock (capturedEvents)
{
Expand Down
Loading