Support signed-out Agents sessions with BYOK models - #329683
Draft
Vritant Bhardwaj (vritant24) wants to merge 12 commits into
Draft
Support signed-out Agents sessions with BYOK models#329683Vritant Bhardwaj (vritant24) wants to merge 12 commits into
Vritant Bhardwaj (vritant24) wants to merge 12 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Vritant Bhardwaj (vritant24)
August 7, 2026 20:22
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Enables signed-out Agents sessions to use BYOK models and adds setup guidance when no usable model exists.
Changes:
- Detects visible BYOK models and bypasses Copilot authentication for advertised BYOK selections.
- Keeps local harnesses accessible while signed out and adds model/sign-in guidance.
- Adds focused availability, authentication, picker, and notification tests.
Show a summary per file
| File | Description |
|---|---|
modelPickerItems.test.ts |
Tests model management during setup. |
chatInputNotificationWidget.test.ts |
Tests dual Copilot target scoping. |
sessionTypeAvailability.test.ts |
Tests signed-out and BYOK availability. |
agentHostAuth.test.ts |
Tests model-specific authentication. |
modelPickerItemSections.ts |
Adds Manage Models to setup state. |
sessionTypeAvailability.ts |
Adds BYOK-aware availability. |
agentHostSessionHandler.ts |
Passes model selection to authentication. |
agentHostAuth.ts |
Identifies BYOK authentication exemptions. |
copilotChatSessionsProvider.test.ts |
Tests session authentication metadata. |
copilotChatSessionsProvider.ts |
Changes legacy harness auth requirements. |
sessionTypeAuthRequirement.test.ts |
Tests notification readiness predicates. |
localAgentHostSessionsProvider.test.ts |
Tests signed-out local availability. |
localAgentHostSessionsProvider.ts |
Marks local harnesses authentication-free. |
localAgentHost.contribution.ts |
Registers signed-out model guidance. |
baseAgentHostSessionsProvider.ts |
Supports provider-specific auth resolution. |
agentHostSignedOutModelsNotification.ts |
Implements reactive setup guidance. |
Review details
Suppressed comments (1)
src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts:71
- Cloud is explicitly a remote Copilot delegation type and still requires GitHub authentication (the availability test at
sessionTypeAvailability.test.ts:153-159asserts this). Advertising it asNonelets the signed-out auth gate count it as usable and lets_preferUsableSessionTypeWhenSignedOutretain/select Cloud, after which session creation reaches an auth-dependent backend. Keep Cloud GitHub-gated.
authRequirement: SessionTypeAuthRequirement.None,
- Files reviewed: 16/16 changed files
- Comments generated: 3
- Review effort level: Balanced
Comment on lines
+67
to
+69
| if (entitlement === ChatEntitlement.Unknown && (type === SessionType.AgentHostCopilot || type === SessionType.AgentHostClaude)) { | ||
| return SessionTypeAvailability.Available; | ||
| } |
Vritant Bhardwaj (vritant24)
marked this pull request as draft
August 7, 2026 20:27
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Vritant Bhardwaj (vritant24)
August 8, 2026 01:30
View session
Contributor
There was a problem hiding this comment.
Review details
Suppressed comments (2)
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts:1531
- This preflight only runs while resolving/creating the session. Later turns compute a fresh
selectedModelin_sendRequestand dispatch it without calling_ensureRequiredAuthentication, so an established BYOK session that switches to (or retains after sign-out) a Copilot-backed model fails the turn instead of triggering the normal sign-in flow. Re-run the model-aware preflight before dispatching each turn/model change.
await this._ensureRequiredAuthentication(this._createModelSelection(request.userSelectedModelId, request.modelConfiguration));
src/vs/platform/agentHost/node/copilot/copilotAgent.ts:1001
- Using
_byokModels.lengthreports the provider as usable even when none of those models is usable in the UI. The renderer bridge includes hidden BYOK models (and the bridge contract allows models withoutmodelIdentifier), while renderer availability explicitly rejects hidden or metadata-less copies. Consequently the Agents window gate can open signed out with no selectable BYOK model, violating the no-usable-model case. Base optionality on the same usable-model predicate or propagate visibility/validity through the bridge.
allowSignedOutWhenUsable && this._byokModels.length > 0 ? { ...copilotResource, required: false } : copilotResource,
- Files reviewed: 30/31 changed files
- Comments generated: 1
- Review effort level: Balanced
Comment on lines
+44
to
+45
| if (!agent?.protectedResources?.some(resource => resource.required !== false)) { | ||
| return false; |
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
chat.agentHost.allowSignedOutWhenUsableRelated to #329667.