mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
fix(cli-tools): guard modelId type before calling indexOf
E2E shakedown v3.8.0: cli-tools quebrava com TypeError quando dynamicModels continha entradas sem .id (objeto retornado diretamente em vez de string).
This commit is contained in:
@@ -180,8 +180,9 @@ export default function CLIToolsPageClient({ machineId: _machineId }) {
|
||||
activeProviders.map((c) => PROVIDER_ID_TO_ALIAS[c.provider] || c.provider)
|
||||
);
|
||||
dynamicModels.forEach((dm) => {
|
||||
const modelId = dm.id || dm;
|
||||
if (seenModels.has(modelId)) return;
|
||||
const rawId = dm?.id ?? dm;
|
||||
const modelId = typeof rawId === "string" ? rawId : "";
|
||||
if (!modelId || seenModels.has(modelId)) return;
|
||||
// Parse alias/model format
|
||||
const slashIdx = modelId.indexOf("/");
|
||||
if (slashIdx === -1) return;
|
||||
|
||||
Reference in New Issue
Block a user