Skip to content

Refresh model catalogs when authentication changes - #329685

Draft
Vritant Bhardwaj (vritant24) wants to merge 2 commits into
mainfrom
vritant24/agent-host-auth-model-refresh
Draft

Refresh model catalogs when authentication changes#329685
Vritant Bhardwaj (vritant24) wants to merge 2 commits into
mainfrom
vritant24/agent-host-auth-model-refresh

Conversation

@vritant24

@vritant24 Vritant Bhardwaj (vritant24) commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

  • rebuild the Manage Models catalog when the resolved default account changes
  • forward Agent Host credential removal when a user signs out
  • remove revoked credentials from the Agent Host authentication cache
  • refresh provider model catalogs after revocation, including disposing Claude's stale Copilot proxy

Related to #329667.

Copilot AI balanced review requested due to automatic review settings August 7, 2026 20:26
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Tyler James Leonhardt (@TylerLeonhardt)

Matched files:

  • src/vs/platform/agentHost/node/claude/claudeAgent.ts

@vritant24
Vritant Bhardwaj (vritant24) marked this pull request as draft August 7, 2026 20:27

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.

Pull request overview

Refreshes model catalogs and revokes cached Agent Host credentials when authentication changes.

Changes:

  • Rebuilds model-management and picker catalogs after account changes.
  • Forwards sign-out revocations and removes cached credentials.
  • Refreshes Claude models and disposes stale proxy handles.
Show a summary per file
File Description
.github/skills/sessions/SKILL.md Documents authentication refresh guidance.
src/vs/platform/agentHost/common/agentService.ts Documents empty-token revocation semantics.
src/vs/platform/agentHost/node/agentHostAuthenticationService.ts Removes revoked cached tokens.
src/vs/platform/agentHost/node/claude/claudeAgent.ts Handles proxy revocation and catalog refresh.
src/vs/platform/agentHost/test/node/claudeAgent.test.ts Tests Claude sign-out behavior.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.ts Forwards credential removal.
src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.ts Refreshes models after account resolution.
src/vs/workbench/contrib/chat/browser/widget/input/modelPicker/modelPickerItemSections.ts Exposes Manage Models while signed out.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostAuth.test.ts Tests removal forwarding.
src/vs/workbench/contrib/chat/test/browser/widget/input/modelPicker/modelPickerItems.test.ts Updates signed-out picker expectations.

Review details

  • Files reviewed: 10/10 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread src/vs/platform/agentHost/node/agentHostAuthenticationService.ts
Comment thread src/vs/platform/agentHost/node/claude/claudeAgent.ts

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.

Review details

Suppressed comments (1)

src/vs/platform/agentHost/node/claude/claudeAgent.ts:587

  • This also removes the already-published native Anthropic catalog. If the subsequent native refresh fails, _refreshModels() takes its all-sources-failed path and deliberately keeps the “last known-good” catalog—but that catalog is now empty—so signing out makes otherwise usable BYOK models disappear. Preserve the current native entries while dropping Copilot entries, then refresh them in the background.
			this._models.set([], undefined);
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@@ -71,7 +71,12 @@ export class AgentHostAuthenticationService {
authenticated = this._tokens.get(this._key(params.resource, scopes))?.token === params.token;
}
if (authenticated) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants