Copilot Chat: Confusing error when BYOK utility model not configured
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Issue
When using a BYOK (Bring Your Own Key) model as the main agent model in VS Code Copilot Chat, switching to Agent mode fails with:
```
No utility model is configured for 'copilot-utility-small' while the selected main agent model is BYOK.
```
This error is confusing because:
1. It doesn't tell the user HOW to configure a utility model
2. It doesn't mention the `chat.byokUtilityModelDefault` setting that can solve this
3. The error persists even after clearing extension cache (because it's a settings issue, not a cache issue)
## Environment
- **VS Code Version**: 1.106+ (current stable)
- **Copilot Extension**: Latest version
- **OS**: Windows 11
- **Model Setup**: BYOK (Bring Your Own Key) configuration
## Steps to Reproduce
1. Open a repository with Copilot Chat enabled
2. Configure a BYOK model as your main agent model (not Copilot's hosted models)
3. Do NOT configure `chat.utilitySmallModel` or `chat.byokUtilityModelDefault` settings
4. Switch from "Ask" mode to "Agent" mode in the chat panel
5. Error appears immediately
## Expected Behavior
The error message should be actionable and tell the user:
- Which settings to configure (`chat.utilitySmallModel` or `chat.byokUtilityModelDefault`)
- That setting `chat.byokUtilityModelDefault` to `'mainAgent'` will use their BYOK model for utility tasks
- This is a configuration requirement, not a bug
## Root Cause
From `extensions/copilot/src/extension/prompt/vscode-node/endpointProviderImpl.ts`:
The error IS created with helpful text, but it may not be surfacing to the user properly in the UI.
## Solution for Users
Add this to VS Code settings (User or Workspace):
**Option 1: Use your BYOK model for utility tasks (recommended)**
```json
{
"chat.byokUtilityModelDefault": "mainAgent"
}
```
**Option 2: Specify a specific utility model**
```json
{
"chat.utilitySmallModel": "anthropic/claude-haiku-4.5"
}
```
## Impact
Medium - prevents use of Agent mode for code generation, file editing, and terminal operations in BYOK setups, but has a straightforward fix.
**Suggested Fix:** Surface the full error message to the user in the UI, or show a notification/banner with the configuration guidance when this error occurs.
Contributor guide
Assessment
This issue has not been assessed yet.