Skip to content

[BUG]: CreateResponseStreamingAsync StreamingResponseErrorUpdate updates don't provide the error #639

@replaysMike

Description

@replaysMike

Describe the bug

When using CreateResponseStreamingAsync() and an error occurs the object of type StreamingResponseErrorUpdate should be providing access to the error but it doesn't seem to.

I don't know if it's related, but the Status property is empty too when I receive StreamingResponseOutputItemAddedUpdate messages.

Steps to reproduce

  1. Perform a query using the WebSearch tool
  2. Use a streamed response
  3. Cause an error to occur and try to fetch information about it

Code snippets

var client = openAi.GetOpenAIResponseClient("gpt-5-mini");
var userQuestion = "";
var options = new ResponseCreationOptions {
  Instructions = "...",
  Tools = {
    ResponseTool.CreateWebSearchTool(null, WebSearchContextSize.Low)
  }
};
await foreach (var update in client.CreateResponseStreamingAsync(userInputText: userQuestion, options))
{
  switch (update)
  {
     case StreamingResponseErrorUpdate error:
        // error.Code and error.Message are blank, but if I dig into the private fields the error is there (such as a throttle error) I just don't have access to it.

        Console.WriteLine($"Error: [{error.Code}] {error.Message}");
      break;
  }
}

OS

Windows

.NET version

9.0

Library version

2.3.0

Metadata

Metadata

Assignees

Labels

needs-author-feedbackWorkflow: More information is needed from author to address the issue.questionCategory: The issue is seeking information about the library or its usage.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions