This commit is contained in:
seb
2026-10-05 11:56:17 +02:00
parent 4a08e7f20b
commit 296fceedc0
6 changed files with 53 additions and 19 deletions

View File

@@ -1,9 +1,6 @@
import * as db from '../../db/modelconversation.js';
import env from '../../config/env.js';
// Model ids that are known to return empty responses from OpenRouter. Requests naming one of
// these are transparently rerouted to `env.defaultModel` instead of failing at generation time.
const RETIRED_MODELS = new Set(['stealth/space-bunny-alpha']);
import { RETIRED_MODELS, resolveDefaultModel } from '../../tools/llm-key.js';
import { emit } from '../sse.js';
import { getOrCreateManager, removeManager } from '../../services/conversationManager.js';
@@ -155,7 +152,7 @@ export function register(app, basePath = '') {
// ignoring the client's choice entirely, so an explicit model selection still works.
const requestedModel = typeof model === 'string' ? model.trim() : '';
const effectiveModel = RETIRED_MODELS.has(requestedModel) || !requestedModel
? env.defaultModel
? await resolveDefaultModel(req.user.id)
: requestedModel;
try {