Skip to content

Use the selected chat model for the Ruby design agent - #4193

Open
Hashim1999164 wants to merge 2 commits into
Shopify:mainfrom
Hashim1999164:fix/chat-agent-custom-model
Open

Use the selected chat model for the Ruby design agent#4193
Hashim1999164 wants to merge 2 commits into
Shopify:mainfrom
Hashim1999164:fix/chat-agent-custom-model

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Aug 18, 2026

Copy link
Copy Markdown

Summary

  • The design chat agent always asked vscode.lm.selectChatModels for Copilot GPT4o, so custom chat models left model undefined and sendRequest crashed
  • It now uses the model already selected for the chat, falls back to Copilot GPT4o if needed, and shows a message instead of throwing when no model is available

Closes #4186

Tests

  • npx tsc covering the vscode extension

@Hashim1999164
Hashim1999164 requested a review from a team as a code owner August 18, 2026 19:28
Comment thread vscode/src/chatAgent.ts Outdated
Comment on lines +91 to +96
if (!model) {
[model] = await vscode.lm.selectChatModels({
vendor: "copilot",
family: "gpt-4o",
});
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We started out pre-selecting gpt-4o because that was the best one available at the time, but with the explosion of models and offerings I'm not sure it makes a whole lot of sense.

Let's remove this completely and just use whatever the user has selected as their model every time.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Dropped the gpt-4o fallback. The design agent now uses only the model selected in the chat picker.

Comment thread vscode/src/chatAgent.ts Outdated
}
if (!model) {
stream.markdown(
"No language model is available for this chat. Select a model in the chat picker and try again.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"No language model is available for this chat. Select a model in the chat picker and try again.",
"No language model selected. Select a model in the chat picker and try again.",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated the error string as suggested.

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.

Cannot read properties of undefined (reading 'sendRequest')

2 participants