fix(ai-chat): drop redundant "(free)" suffix from OpenRouter model names

OpenRouter appends "(free)" to the display name of its free-tier model
variants (e.g. "Liquid AI: LFM2.5-2.6B (free)"). The ":free" model id
already conveys this, so the suffix is redundant in the human-facing
name shown across Puter and the developer docs.

Strip a trailing "(free)" from the coerced display name while keeping
the original name as an alias so existing references still resolve.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018q5AWeB6pvt3LPHYxknis6
This commit is contained in:
Claude
2026-08-12 13:48:50 +00:00
parent e8236a100c
commit f24d40a65f
@@ -268,12 +268,17 @@ export class OpenRouterProvider implements IChatProvider {
if (!microcentCosts.request) {
microcentCosts.request = 0;
}
// OpenRouter appends "(free)" to the display name of its free-tier
// model variants. The ":free" model id already conveys that, so
// drop the redundant suffix from the human-facing name.
const displayName = model.name.replace(/\s*\(free\)\s*$/i, '');
coerced_models.push({
id: `openrouter:${model.id}`,
name: `${model.name} (OpenRouter)`,
name: `${displayName} (OpenRouter)`,
aliases: [
model.id,
model.name,
displayName,
`openrouter/${model.id}`,
model.id.split('/').slice(1).join('/'),
],