fix(coding-agent): add pnpm self-update prune hint (#6279)

Adds a pnpm-specific self-update recovery hint when pi update fails during self-update.
Fixes #6215.
This commit is contained in:
Raj
2026-07-03 16:28:35 +05:30
committed by GitHub
parent c9715af358
commit 4a9c962b59
2 changed files with 61 additions and 2 deletions
@@ -372,6 +372,11 @@ function printSelfUpdateFallback(command: SelfUpdateCommand): void {
console.error(chalk.dim(`If this keeps failing, run this command yourself: ${command.display}`));
}
function printPnpmSelfUpdateMetadataHint(): void {
console.error(chalk.yellow("If pnpm reports missing package versions, its cached registry metadata may be stale."));
console.error(chalk.yellow(`Run \`pnpm store prune\` and retry \`${APP_NAME} update --self\`.`));
}
function printSelfUpdateNote(note: string): void {
const trimmedNote = note.trim();
if (!trimmedNote) {
@@ -753,6 +758,9 @@ export async function handlePackageCommand(
} catch (error: unknown) {
const message = error instanceof Error ? error.message : "Unknown package command error";
console.error(chalk.red(`Error: ${message}`));
if (installMethod === "pnpm") {
printPnpmSelfUpdateMetadataHint();
}
printSelfUpdateFallback(selfUpdateCommand);
process.exitCode = 1;
return true;