Skip to content

Fix bugs related to setting the right Chat model. (Fixes Issue #323765)#323767

Open
danielrobbins wants to merge 1 commit into
microsoft:mainfrom
danielrobbins:drobbins/preserve-chat-retry-model-configuration
Open

Fix bugs related to setting the right Chat model. (Fixes Issue #323765)#323767
danielrobbins wants to merge 1 commit into
microsoft:mainfrom
danielrobbins:drobbins/preserve-chat-retry-model-configuration

Conversation

@danielrobbins

Copy link
Copy Markdown

This patch was originally created to address a bug where encountering an error and a "Try Again" button in the Chat window does not allow a different model to be selected, preventing the user from switching to a working model.

Upon investigation, multiple inconsistencies were found related to feeding the model selection widget's current state in various places. This patch centralizes this in getSelectedModelRequestOptions() to avoid needing to keep multiple call sites in sync going forward.

More specifically, several resend and confirmation paths passed only the selected model ID. That can drop editor-scoped model configuration, such as custom per-model settings, and cause follow-up requests to use configuration that does not match the visible model picker state. The new helper keeps the selected model ID and its scoped configuration together whenever the widget builds Chat request options.

To test: Select a third-party endpoint for a new chat, then successfully use it. Now, simulate an error on the endpoint, so that it will return an error to Chat on the next request. Now, attempt to continue with a new turn in Chat, resulting in an error from the endpoint. Chat will display a "Try Again" button. Now, pretend you are a user needing to select a working Model since your current model experienced an error. Before pressing "Try Again", select a new model, then hit "Try Again". With the patch, the new model will be utilized. Without the patch, the original failing model will continue to be selected, the original prompt will be re-submitted, and is likely to re-trigger the same error if the error was related to prompt content, size, quota, etc.

Copilot AI review requested due to automatic review settings June 30, 2026 19:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@danielrobbins

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="BreezyOps, Inc."

@danielrobbins danielrobbins changed the title Fix bugs related to setting the right Chat model. (#323765) Jun 30, 2026
@danielrobbins danielrobbins force-pushed the drobbins/preserve-chat-retry-model-configuration branch from 9604293 to fcfd103 Compare June 30, 2026 20:46
This patch was originally created to address a bug where a Try Again in
the Chat window would not allow a different model to be selected.

Multiple inconsistencies were found related to feeding the model
selection widget's current state in various places. This patch
centralizes this in getSelectedModelRequestOptions() to avoid needing to
keep multiple call sites in sync going forward.

More specifically, several resend and confirmation paths passed only the
selected model ID. That can drop editor-scoped model configuration, such
as custom per-model settings, and cause follow-up requests to use
configuration that does not match the visible model picker state. The
new helper keeps the selected model ID and its scoped configuration
together whenever the widget builds Chat request options.

Fixes microsoft#323765
@danielrobbins danielrobbins force-pushed the drobbins/preserve-chat-retry-model-configuration branch from fcfd103 to d2f679c Compare June 30, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants