fix(coding-agent): skip redundant npm package updates

closes #3000
This commit is contained in:
Mario Zechner
2026-04-20 19:12:52 +02:00
parent 3054fd7a3b
commit b73212616d
3 changed files with 44 additions and 1 deletions

View File

@@ -1001,6 +1001,20 @@ export class DefaultPackageManager implements PackageManager {
const parsed = this.parseSource(source);
if (parsed.type === "npm") {
if (parsed.pinned) return;
const installedPath = this.getNpmInstallPath(parsed, scope);
const installedVersion = existsSync(installedPath) ? this.getInstalledNpmVersion(installedPath) : undefined;
if (installedVersion) {
try {
const latestVersion = await this.getLatestNpmVersion(parsed.name);
if (latestVersion === installedVersion) {
return;
}
} catch {
// Preserve existing update behavior when version lookup fails.
}
}
await this.withProgress("update", source, `Updating ${source}...`, async () => {
await this.installNpm(
{