fix: preserve streaming structured output finalization

Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/f62076ef-558d-49e8-8fe2-f38d527c9639

Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-19 05:50:10 +00:00
committed by GitHub
co-authored by eavanvalkenburg
parent cb8249ed95
commit b07f055430
2 changed files with 47 additions and 2 deletions
@@ -681,8 +681,13 @@ class RawOpenAIChatClient( # type: ignore[misc]
except Exception as ex:
self._handle_request_error(ex)
response_format = validated_options.get("response_format") if validated_options else None
return self._build_response_stream(_stream(), response_format=response_format)
return ResponseStream(
_stream(),
finalizer=lambda updates: self._finalize_response_updates(
updates,
response_format=validated_options.get("response_format") if validated_options else None,
),
)
# Non-streaming
async def _get_response() -> ChatResponse: