fix(plugins): harden runtime dependency repair

This commit is contained in:
Peter Steinberger
2026-04-25 02:07:13 +01:00
parent cc0f3067a0
commit 8262735354
6 changed files with 163 additions and 44 deletions

View File

@@ -1112,19 +1112,19 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
} else if (updateInstallKind === "git") {
actions.push(`Run git update flow on channel ${channel} (fetch/rebase/build/doctor)`);
} else if (packageAlreadyCurrent) {
actions.push(`Skip package update; current version already matches ${targetVersion}`);
actions.push(
`Refresh package install with spec ${packageInstallSpec ?? tag}; current version already matches ${targetVersion}`,
);
} else {
actions.push(`Run global package manager update with spec ${packageInstallSpec ?? tag}`);
}
if (!packageAlreadyCurrent) {
actions.push("Run plugin update sync after core update");
actions.push("Refresh shell completion cache (if needed)");
actions.push(
shouldRestart
? "Restart gateway service and run doctor checks"
: "Skip restart (because --no-restart is set)",
);
}
actions.push("Run plugin update sync after core update");
actions.push("Refresh shell completion cache (if needed)");
actions.push(
shouldRestart
? "Restart gateway service and run doctor checks"
: "Skip restart (because --no-restart is set)",
);
const notes: string[] = [];
if (opts.tag && updateInstallKind === "git") {
@@ -1195,25 +1195,6 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
);
}
if (packageAlreadyCurrent) {
const mode = isPackageManagerUpdateMode(updateStatus.packageManager)
? updateStatus.packageManager
: "unknown";
const result: UpdateRunResult = {
status: "skipped",
mode,
root,
reason: "already-current",
before: { version: currentVersion },
after: { version: currentVersion },
steps: [],
durationMs: 0,
};
printResult(result, opts);
defaultRuntime.exit(0);
return;
}
if (updateInstallKind === "package") {
const runtimePreflightError = await resolvePackageRuntimePreflightError({
tag,