Cherry pick PR for rel-0.9.0#491
Open
baijumeswani wants to merge 3 commits intoreleases/rel-0.9.0from
Open
Conversation
…ChatClient streaming path (#466) Fixes the bug where `ChatClient` streaming was not checking the `Response.Error` field returned by `ExecuteCommandWithCallbackAsync`. When the native layer reported an error without invoking any callbacks, the streaming method would silently complete with an empty stream instead of propagating the error to the caller. The equivalent fix for `AudioClient` was merged separately via PR #471. ## Changes Made - **`ChatClient.cs`**: Capture the return value of `ExecuteCommandWithCallbackAsync` and, when it carries an error (and no callback has already failed), complete the channel with a `FoundryLocalException` so the error propagates to the consumer's `await foreach` loop. Added an internal constructor accepting `ICoreInterop` and `ILogger` for dependency injection in unit tests. - **`ChatClientStreamingErrorTests.cs`**: Unit tests verifying that native-layer errors reported via `Response.Error` are propagated as `FoundryLocalException` to callers, and that a successful (no-error) response completes the stream normally. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>ExecuteCommandWithCallbackAsync response not checked</issue_title> > <issue_description>ExecuteCommandWithCallbackAsync returns a Response whose .Error field may contain an error from the native layer (e.g. missing audio file, invalid model, etc.). Both AudioClient and ChatClient streaming paths are ignoring this return value, so when the native side reported an error without invoking any callbacks the channel was completed successfully and the caller observed an empty stream instead of an exception. > > Capture the Response and, when it carries an error, complete the channel with a FoundryLocalException so the error propagates to the consumer's `await foreach` loop.</issue_description> > > <agent_instructions>Add necessary unit tests.</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #465 <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com> Co-authored-by: Baiju Meswani <baijumeswani@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Baiju Meswani <bmeswani@microsoft.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
prathikr
approved these changes
Mar 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.