From 192fcccd2d897ad069a7e069c59e8ba626987dbf Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 23 Jun 2026 18:20:15 +0200 Subject: [PATCH] fix(coding-agent): hint when extensions fail to load --- packages/coding-agent/CHANGELOG.md | 1 + packages/coding-agent/src/main.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 324822ad5..2add6cb3f 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -14,6 +14,7 @@ ### Fixed +- Fixed extension-related crash and startup-failure reporting to suggest restarting with `pi -ne`. - Fixed context usage and compaction estimates to ignore malformed all-zero assistant usage after truncated responses ([#5526](https://github.com/earendil-works/pi/pull/5526) by [@dmmulroy](https://github.com/dmmulroy)). - Fixed `pi --resume` to load user package themes and resolve automatic light/dark theme settings. - Fixed `models.json` custom providers so stored credentials can satisfy auth without a redundant provider-level `apiKey` ([#5953](https://github.com/earendil-works/pi/issues/5953)). diff --git a/packages/coding-agent/src/main.ts b/packages/coding-agent/src/main.ts index 568d96d15..50a19bbaf 100644 --- a/packages/coding-agent/src/main.ts +++ b/packages/coding-agent/src/main.ts @@ -49,6 +49,8 @@ import { handleConfigCommand, handlePackageCommand } from "./package-manager-cli import { isLocalPath, normalizePath, resolvePath } from "./utils/paths.ts"; import { cleanupWindowsSelfUpdateQuarantine } from "./utils/windows-self-update.ts"; +const EXTENSION_LOAD_FAILURE_HINT = 'Hint: Start without extensions using "pi -ne".'; + /** * Read all content from piped stdin. * Returns undefined if stdin is a TTY (interactive terminal). @@ -774,6 +776,9 @@ export async function main(args: string[], options?: MainOptions) { time("resolveModelScope"); reportDiagnostics(runtime.diagnostics); if (runtime.diagnostics.some((diagnostic) => diagnostic.type === "error")) { + if (runtime.diagnostics.some((diagnostic) => diagnostic.message.includes("Failed to load extension"))) { + console.error(chalk.yellow(EXTENSION_LOAD_FAILURE_HINT)); + } process.exit(1); } time("createAgentSession");