titan-agent 5.5.29 → 5.5.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1367,6 +1367,22 @@ async function startGateway(options) {
1367
1367
  res.status(400).json({ error: "content (or message) must be a non-empty string" });
1368
1368
  return;
1369
1369
  }
1370
+ if (requestedModel && typeof requestedModel === "string") {
1371
+ const { tryResolveModel, getKnownProviderNames } = await import("../providers/router.js");
1372
+ if (!tryResolveModel(requestedModel)) {
1373
+ const providers = getKnownProviderNames();
1374
+ const requestedProviderName = requestedModel.split("/")[0] || requestedModel;
1375
+ const lc = requestedProviderName.toLowerCase();
1376
+ const suggestions = providers.filter((p) => p.startsWith(lc.slice(0, 3)) || lc.includes(p)).slice(0, 5);
1377
+ res.status(400).json({
1378
+ error: "unknown_model",
1379
+ message: `Unknown model "${requestedModel}". Provider "${requestedProviderName}" is not registered.`,
1380
+ suggestions: suggestions.length > 0 ? suggestions.map((p) => `${p}/...`) : void 0,
1381
+ availableProviders: providers
1382
+ });
1383
+ return;
1384
+ }
1385
+ }
1370
1386
  const safeUserId = channel === "api" ? "api-user" : userId || "api-user";
1371
1387
  const hasExplicitWidgetIntent = /\b(?:widget|panel|dashboard|monitor|hub|tab|page|view|gallery|kitchen|scheduler|router|lab|tools)\b/i.test(content);
1372
1388
  const systemWidgetShortcuts = [