Skip to content

Comments

remove id#296497

Merged
sandy081 merged 1 commit intomainfrom
sandy081/anonymous-gorilla
Feb 20, 2026
Merged

remove id#296497
sandy081 merged 1 commit intomainfrom
sandy081/anonymous-gorilla

Conversation

@sandy081
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 20, 2026 12:00
@sandy081 sandy081 enabled auto-merge (squash) February 20, 2026 12:00
@sandy081 sandy081 self-assigned this Feb 20, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the id field from the model entry type definitions in IChatControlResponse. The change refactors the data structure so that model IDs are stored as keys in the Record rather than as a field within each entry object.

Changes:

  • Removed readonly id: string field from the type definitions for both free and paid model entries in IChatControlResponse
  • Removed validation checks for typeof entry.id !== 'string' in the processing logic
Comments suppressed due to low confidence (3)

src/vs/workbench/contrib/chat/common/languageModels.ts:1432

  • After removing the id field from the type definition, this code is accessing entry.id on line 1431, which will be undefined. Since the response format is Record<string, {...}> where the key is the model ID, you need to use Object.entries() instead of Object.values() to access both the key (model ID) and the value. The code should iterate over entries like: for (const [id, entry] of Object.entries(response.free)) and then use id as the key instead of entry.id.

This issue also appears on line 1435 of the same file.

		if (response?.free) {
			const freeEntries = Array.isArray(response.free) ? response.free : Object.values(response.free);
			for (const entry of freeEntries) {
				if (!entry || !isObject(entry)) {
					continue;
				}
				free[entry.id] = { label: entry.label, featured: entry.featured };
			}

src/vs/workbench/contrib/chat/common/languageModels.ts:1442

  • After removing the id field from the type definition, this code is accessing entry.id on line 1441, which will be undefined. Since the response format is Record<string, {...}> where the key is the model ID, you need to use Object.entries() instead of Object.values() to access both the key (model ID) and the value. The code should iterate over entries like: for (const [id, entry] of Object.entries(response.paid)) and then use id as the key instead of entry.id.
		if (response?.paid) {
			const paidEntries = Array.isArray(response.paid) ? response.paid : Object.values(response.paid);
			for (const entry of paidEntries) {
				if (!entry || !isObject(entry)) {
					continue;
				}
				paid[entry.id] = { label: entry.label, featured: entry.featured, minVSCodeVersion: entry.minVSCodeVersion };
			}

src/vs/workbench/contrib/chat/common/languageModels.ts:1439

  • The validation was updated to remove the id type check, but it should verify that required fields exist. Since label is a required field in the type definition, consider adding a validation check like typeof entry.label !== 'string' to ensure the data is well-formed before using it.
				if (!entry || !isObject(entry)) {
					continue;

@sandy081 sandy081 merged commit 7a0b83f into main Feb 20, 2026
22 checks passed
@sandy081 sandy081 deleted the sandy081/anonymous-gorilla branch February 20, 2026 12:13
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