Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

refactor(local-installation): return deciding probe round directly

Dongdong Chen74fe482e6d5f
diff --git a/packages/local-installation/src/npm-registry.ts b/packages/local-installation/src/npm-registry.ts
index b8d6db26..2adea410 100644
--- a/packages/local-installation/src/npm-registry.ts
+++ b/packages/local-installation/src/npm-registry.ts
@@ -163,11 +163,7 @@ export async function probeNpmRegistries(
roundRatio(first, second) >= DECISIVE_RATIO
)
return results;
- if ((wins.get(first.registry) ?? 0) >= 2) break;
+ if ((wins.get(first.registry) ?? 0) >= 2) return results;
}
- return [...lastAnswered].sort(
- (left, right) =>
- (wins.get(right.registry) ?? 0) - (wins.get(left.registry) ?? 0) ||
- compareProbe(left, right),
- );
+ return lastAnswered;
}