Remove requester info from API#277233
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes requester information from the chat agent API in favor of using a generic user profile. The changes eliminate the IChatRequesterInformation interface and all associated properties that stored requester username and avatar icons, replacing them with hardcoded values ("User" username and account codicon).
Key Changes:
- Removed
IChatRequesterInformationinterface and related API surface - Updated chat view models to return hardcoded user profile information
- Cleaned up serialization interfaces and test data
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/chatAgents.ts | Removed IChatRequesterInformation interface and requester property from IChatAgentMetadata |
| src/vs/workbench/api/common/extHostChatAgents2.ts | Removed _requester field and related getter/setter from ExtHostChatAgent class |
| src/vs/workbench/contrib/chat/common/chatModel.ts | Removed requester-related properties from model interfaces, removed username/avatar getters, simplified serialization |
| src/vs/workbench/contrib/chat/common/chatViewModel.ts | Changed username to return hardcoded "User" string and avatarIcon to return Codicon.account |
| src/vs/workbench/contrib/chat/common/chatServiceImpl.ts | Removed requester fields from serialized metadata object |
| src/vs/workbench/contrib/chat/test/common/chatModel.test.ts | Removed requester fields from test data objects |
| src/vs/workbench/contrib/chat/test/common/chatService.test.ts | Updated updateAgent calls to pass empty objects instead of requester information |
| import { ChatAgentVoteDirection, ChatAgentVoteDownReason, IChatChangesSummary, IChatCodeCitation, IChatContentReference, IChatFollowup, IChatMcpServersStarting, IChatProgressMessage, IChatResponseErrorDetails, IChatTask, IChatUsedContext } from './chatService.js'; | ||
| import { countWords } from './chatWordCounter.js'; | ||
| import { CodeBlockModelCollection } from './codeBlockModelCollection.js'; | ||
| import { Codicon } from '../../../../base/common/codicons.js'; |
There was a problem hiding this comment.
The Codicon import should be grouped with other imports from base/common to follow VS Code's import organization conventions. Move this import to be adjacent to the existing base/common imports at the top of the file.
| get avatarIcon() { | ||
| return this._model.avatarIconUri; | ||
| get avatarIcon(): ThemeIcon { | ||
| return Codicon.account; |
There was a problem hiding this comment.
The return type is declared as ThemeIcon but Codicon.account returns a CSSIcon. The return type should be ThemeIcon | URI | undefined to match the original interface, or the import should include ThemeIcon from the codicons module and wrap the codicon appropriately.
| return Codicon.account; | |
| return new ThemeIcon(Codicon.account.id); |
| const data = obj as IExportableChatData; | ||
| return typeof data === 'object' && | ||
| typeof data.requesterUsername === 'string'; | ||
| return typeof data === 'object'; |
There was a problem hiding this comment.
This validation is too permissive and will return true for null values since typeof null === 'object'. Add a null check: return typeof data === 'object' && data !== null;
| return typeof data === 'object'; | |
| return typeof data === 'object' && data !== null; |
Removes requester information form the API in favor of rendering a generic user profile since it will save us an API request
cc @roblourens