Browse Source

fix(studio): probe returns knownModels when /models is unavailable

When discoveredModels is empty and probe succeeds, return the full
knownModels list (7 for MiniMax) instead of just the probed model.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fanghanjun 6 tháng trước cách đây
mục cha
commit
2e7869000f
1 tập tin đã thay đổi với 1 bổ sung và 1 xóa
  1. 1 1
      packages/studio/src/api/server.ts

+ 1 - 1
packages/studio/src/api/server.ts

@@ -484,7 +484,7 @@ async function probeServiceCapabilities(args: {
         await chatCompletion(client, model, [{ role: "user", content: "hi" }], { maxTokens: 248 });
         const models = discoveredModels.length > 0
           ? discoveredModels
-          : [{ id: model, name: model }];
+          : preset?.knownModels?.map((id) => ({ id, name: id })) ?? [{ id: model, name: model }];
         return {
           ok: true,
           models,