The latest Copilot Chat in VS Code extension has an update for the auto model selection feature. Its behavior can be simply summarized as:
- First, the user selects the "Auto" model from the model list
- The Copilot extension sends a POST request to the
/models/session endpoint, which returns fields such as available_models, selected_model, etc. Among these, the selected_model field is an output based on intelligent model selection using current discount information, traffic, etc. (As of Commit 7c4e32b, the architecture based on context and routing APIs is still experimental and subject to change.)
- Next, the extension constructs the
completion request based on the output of the intelligent model selection to complete the upload of the chat history.
You can refer to the following image for understanding (note: the screenshot was taken using Visual Studio Code Insider edition along with the Copilot extension built from the latest version, which may differ from the interface of the stable release)

To update this plugin by adding auto model selection functionality, I envision that we could achieve this by:
- Reusing the
$ prefix and adding $auto to the model selection (it can also be set in the config via model = "auto")
- When selecting the
auto model, we construct a simulated request to mimic the above request and obtain the routed model's response.
The latest Copilot Chat in VS Code extension has an update for the auto model selection feature. Its behavior can be simply summarized as:
/models/sessionendpoint, which returns fields such asavailable_models,selected_model, etc. Among these, theselected_modelfield is an output based on intelligent model selection using current discount information, traffic, etc. (As of Commit 7c4e32b, the architecture based on context and routing APIs is still experimental and subject to change.)completionrequest based on the output of the intelligent model selection to complete the upload of the chat history.You can refer to the following image for understanding (note: the screenshot was taken using Visual Studio Code Insider edition along with the Copilot extension built from the latest version, which may differ from the interface of the stable release)

To update this plugin by adding auto model selection functionality, I envision that we could achieve this by:
$prefix and adding$autoto the model selection (it can also be set in the config viamodel = "auto")automodel, we construct a simulated request to mimic the above request and obtain the routed model's response.