{{ message }}
Repository navigation
Conversation
Session-scoped model filtering kept only models targeting the session type, which hid unscoped BYOK/custom-endpoint models from the Agents model picker even though they stayed selectable elsewhere. Keep session-targeted models first, but also offer valid unscoped BYOK models, and treat them as valid for the session in isModelValidForSession. Mode and inline-chat capability filtering now applies to session-targeted models too. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
What changed in this PR
Fixes session-scoped model filtering so unscoped BYOK/custom-endpoint models remain visible/selectable alongside session-targeted models, preventing them from disappearing in Agents flows (e.g., WSL) when a session type is enforced.
Changes:
- Update session-scoped filtering to return session-targeted models first, then unscoped BYOK models that are selectable and compatible with the current mode/location.
- Update session validity rules to treat unscoped BYOK models as valid when a session has targeted models.
- Expand/enable tests to cover the new BYOK-in-session behavior and mode/location compatibility.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputModelUtils.ts | Adjusts session-scoped filtering/validation to include unscoped BYOK models alongside session-scoped models. |
| src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputModelUtils.test.ts | Enables an existing test and adds coverage for unscoped BYOK models in session-scoped pools. |
Review effort: Lite
| @@ -37,10 +42,22 @@ export function filterModelsForSession( | |||
| location: ChatAgentLocation, | |||
| ): ILanguageModelChatMetadataAndIdentifier[] { | |||
| if (sessionType && sessionType !== 'local' && hasModelsTargetingSession(models, sessionType)) { | |||
Comment on lines
+52
to
58
| const byokScoped = models.filter(entry => | ||
| !entry.metadata?.targetChatSessionType && | ||
| isByokModel(entry.metadata) && | ||
| entry.metadata?.isUserSelectable !== false && | ||
| isModelSupportedForMode(entry, currentModeKind) && | ||
| isModelSupportedForInlineChat(entry, location) | ||
| ); |
This branch has not been deployed
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.



Summary
When a chat session is scoped to a specific session type, the model picker was filtering to only models that explicitly target that session. This unintentionally dropped valid unscoped BYOK/custom-endpoint models from the Agents model list, even though they were still available in editor mode.
This made custom endpoint models appear unavailable in the WSL agent flow even though they were otherwise valid.
Fix
This is a narrow fix in the model filtering layer and does not change broader provider or endpoint behavior.
Why this is safe
Validation
Screenshot
