mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
Clarify model names in selector
This commit is contained in:
@@ -63,8 +63,6 @@ import {
|
||||
type ProviderSelectorProvider,
|
||||
} from "@/provider-selection/provider-selection";
|
||||
|
||||
// TODO: this should be configured per provider in the provider manifest
|
||||
const PROVIDERS_WITH_MODEL_DESCRIPTIONS = new Set(["opencode", "pi"]);
|
||||
const DESKTOP_PROVIDER_VIEW_MIN_HEIGHT = 220;
|
||||
const DESKTOP_PROVIDER_VIEW_MAX_HEIGHT = 400;
|
||||
const DESKTOP_PROVIDER_VIEW_BASE_HEIGHT = 80;
|
||||
@@ -198,12 +196,10 @@ function ModelRow({
|
||||
],
|
||||
);
|
||||
|
||||
const showDescription = row.description && PROVIDERS_WITH_MODEL_DESCRIPTIONS.has(row.provider);
|
||||
|
||||
return (
|
||||
<ComboboxItem
|
||||
label={row.modelLabel}
|
||||
description={showDescription ? row.description : undefined}
|
||||
description={row.description}
|
||||
selected={isSelected}
|
||||
elevated={elevated}
|
||||
onPress={onPress}
|
||||
|
||||
@@ -56,7 +56,7 @@ describe("combined model selector data", () => {
|
||||
providerLabel: "Codex",
|
||||
modelId: "gpt-5.4",
|
||||
modelLabel: "GPT-5.4",
|
||||
description: undefined,
|
||||
description: "gpt-5.4",
|
||||
isDefault: undefined,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -47,7 +47,7 @@ function buildModelRows(
|
||||
providerLabel,
|
||||
modelId: model.id,
|
||||
modelLabel: model.label,
|
||||
description: model.description,
|
||||
description: model.description ?? model.id,
|
||||
isDefault: model.isDefault,
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -1158,6 +1158,11 @@ describe("transformPiModels", () => {
|
||||
id: "openrouter/google/gemini-2.5-flash-lite",
|
||||
label: "openrouter/google/gemini_2.5 flash lite",
|
||||
},
|
||||
{
|
||||
provider: "pi",
|
||||
id: "openrouter/openai/gpt-5.5",
|
||||
label: "openrouter/OpenAI: GPT-5.5",
|
||||
},
|
||||
]),
|
||||
).toEqual([
|
||||
{
|
||||
@@ -1166,6 +1171,12 @@ describe("transformPiModels", () => {
|
||||
label: "gemini 2.5 flash lite",
|
||||
description: "openrouter/google/gemini_2.5 flash lite",
|
||||
},
|
||||
{
|
||||
provider: "pi",
|
||||
id: "openrouter/openai/gpt-5.5",
|
||||
label: "GPT-5.5",
|
||||
description: "openrouter/OpenAI: GPT-5.5",
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -237,7 +237,13 @@ interface PiSlashCommandInvocation {
|
||||
type AutoCompactMode = boolean | "toggle" | "unknown";
|
||||
|
||||
function normalizePiModelLabel(label: string): string {
|
||||
return label.trim().replace(/[_\s]+/g, " ");
|
||||
const normalizedLabel = label.trim().replace(/[_\s]+/g, " ");
|
||||
const vendorSeparatorIndex = normalizedLabel.indexOf(": ");
|
||||
if (vendorSeparatorIndex === -1) {
|
||||
return normalizedLabel;
|
||||
}
|
||||
|
||||
return normalizedLabel.slice(vendorSeparatorIndex + 2).trim();
|
||||
}
|
||||
|
||||
export function transformPiModels(models: AgentModelDefinition[]): AgentModelDefinition[] {
|
||||
|
||||
Reference in New Issue
Block a user