Browse Source

refactor: make array model variant matching explicit

lf 1 month ago
parent
commit
94909372a6
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/index.ts

+ 4 - 4
src/index.ts

@@ -413,10 +413,10 @@ const OhMyOpenCodeLite: Plugin = async (ctx) => {
     const chainMatches = modelArrayMap[agentName]?.filter(
       (entry) => entry.id === model,
     );
-    if (chainMatches?.length === 1) {
-      return chainMatches[0].variant ?? defaultVariant;
-    }
-    if (chainMatches && chainMatches.length > 1) {
+    if (chainMatches) {
+      if (chainMatches.length === 1) {
+        return chainMatches[0].variant ?? defaultVariant;
+      }
       return undefined;
     }