-
Notifications
You must be signed in to change notification settings - Fork 141
Description
Description
The model preference matching in positron.assistant.models.preference.byProvider is case-sensitive, but the documentation states it should be case-insensitive.
Steps to Reproduce
- Open Positron settings
- Set the following configuration:
{
"positron.assistant.models.preference.byProvider": {
"anthropic-api": "haiku"
}
}- Restart Positron
- Open the Assistant model picker dropdown
Expected: "Claude Haiku 4.5" should be marked as the default (since "haiku" should match "Haiku" case-insensitively)
Actual: No model is marked as default, or the first model becomes default. The matching fails because "haiku" (lowercase) doesn't match "Haiku" (uppercase) in the model name.
Workaround: Use "Haiku" with capital H, or use a pattern that matches the lowercase model ID like "haiku-4".
Root Cause
In extensions/positron-assistant/src/modelResolutionHelpers.ts at line 58, the matching uses case-sensitive .includes():
if (id.includes(userDefault) || name?.includes(userDefault)) {
return true;
}Documentation vs Implementation
The setting description in package.nls.json states:
"Matching is case-insensitive and supports partial matches on model ID or name."
But the implementation is case-sensitive.
Proposed Fix
Convert to lowercase for comparison:
const idLower = id.toLowerCase();
const nameLower = name?.toLowerCase();
const userDefaultLower = userDefault.toLowerCase();
if (idLower.includes(userDefaultLower) || nameLower?.includes(userDefaultLower)) {
return true;
}Impact
- Affects both
positron.assistant.models.preference.byProviderandpositron.assistant.models.preference.globalsettings - Users must match the exact casing of model names/IDs, which is unintuitive
- Documentation is misleading
Related
- Setting:
positron.assistant.models.preference.byProvider - Setting:
positron.assistant.models.preference.global - Introduced in PR Model preference refactor #11096 (Model preference refactor)
- File:
extensions/positron-assistant/src/modelResolutionHelpers.ts