Skip to content

Assistant: Model preference matching is case-sensitive despite documentation claiming case-insensitive #11188

@cameronmpalmer

Description

@cameronmpalmer

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

  1. Open Positron settings
  2. Set the following configuration:
{
  "positron.assistant.models.preference.byProvider": {
    "anthropic-api": "haiku"
  }
}
  1. Restart Positron
  2. 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.byProvider and positron.assistant.models.preference.global settings
  • 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

Metadata

Metadata

Assignees

Labels

area: assistantIssues related to Positron Assistant

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions