From 0f6e1a115d2bcb14a36b54968fdbcfeb1d20d5f6 Mon Sep 17 00:00:00 2001 From: Sebastien Tardif Date: Mon, 23 Nov 2026 08:26:21 -0800 Subject: [PATCH 1/3] fix: tell the truth when the CLI is too old or install has no build Show Status no longer opens with "Patchloom is ready." when the detected CLI is unsupported. The first Output line matches the warning toast. Managed install on an unsupported platform offers Open Settings. The walkthrough no longer says managed install is recommended on all platforms. Signed-off-by: Sebastien Tardif --- src/commands/managedInstall.ts | 25 ++++++++++++++++--------- src/install/managed.ts | 11 +++++++++++ src/status/details.ts | 7 ++++++- test/unit/binary.test.ts | 12 ++++++++++++ test/unit/initializeProject.test.ts | 15 +++++++++++++++ walkthrough/install.md | 2 +- 6 files changed, 61 insertions(+), 11 deletions(-) diff --git a/src/commands/managedInstall.ts b/src/commands/managedInstall.ts index 2aa8dad..1874af4 100644 --- a/src/commands/managedInstall.ts +++ b/src/commands/managedInstall.ts @@ -4,6 +4,7 @@ import { resolvePatchloomStatus, PATCHLOOM_RELEASES_URL, clearPatchloomStatusInf import { decideManagedUpdate, resolveManagedBinaryVersion } from "../binary/managedUpdate.js"; import { detectManagedInstallTarget, + unsupportedManagedInstallNotice, fetchLatestReleaseVersion, getManagedInstallRoot, ManagedInstallStage, @@ -61,9 +62,11 @@ export async function installPatchloom(): Promise { const target = detectManagedInstallTarget(); if (!target) { - await vscode.window.showErrorMessage( - `Managed install is not supported on this platform (${process.platform}/${process.arch}).` - ); + const notice = unsupportedManagedInstallNotice(process.platform, process.arch); + const choice = await vscode.window.showErrorMessage(notice.message, notice.actionTitle); + if (choice === notice.actionTitle) { + await vscode.commands.executeCommand(notice.actionCommand); + } return; } @@ -106,9 +109,11 @@ export async function updatePatchloom(): Promise { const target = detectManagedInstallTarget(); if (!target) { - await vscode.window.showErrorMessage( - `Managed install is not supported on this platform (${process.platform}/${process.arch}).` - ); + const notice = unsupportedManagedInstallNotice(process.platform, process.arch); + const choice = await vscode.window.showErrorMessage(notice.message, notice.actionTitle); + if (choice === notice.actionTitle) { + await vscode.commands.executeCommand(notice.actionCommand); + } return; } @@ -181,9 +186,11 @@ export async function reinstallPatchloom(): Promise { const target = detectManagedInstallTarget(); if (!target) { - await vscode.window.showErrorMessage( - `Managed install is not supported on this platform (${process.platform}/${process.arch}).` - ); + const notice = unsupportedManagedInstallNotice(process.platform, process.arch); + const choice = await vscode.window.showErrorMessage(notice.message, notice.actionTitle); + if (choice === notice.actionTitle) { + await vscode.commands.executeCommand(notice.actionCommand); + } return; } diff --git a/src/install/managed.ts b/src/install/managed.ts index d4f3631..5cf7ef6 100644 --- a/src/install/managed.ts +++ b/src/install/managed.ts @@ -268,6 +268,17 @@ export function detectManagedInstallTarget( return undefined; } +export function unsupportedManagedInstallNotice( + platform: string, + arch: string +): { message: string; actionTitle: string; actionCommand: string } { + return { + message: `Managed install is not supported on this platform (${platform}/${arch}). Set patchloom.path to a Patchloom binary you already have.`, + actionTitle: "Open Settings", + actionCommand: "patchloom.openPatchloomSettings" + }; +} + const MUSL_ARCH_MAP: Partial> = { x64: "x86_64", arm64: "aarch64" diff --git a/src/status/details.ts b/src/status/details.ts index 1597b64..07b3cf2 100644 --- a/src/status/details.ts +++ b/src/status/details.ts @@ -14,8 +14,13 @@ export interface SetupAction { } export function buildStatusDetails(status: PatchloomStatus, workspaceReadiness?: WorkspaceReadiness): string { + const headline = !status.ready + ? "Patchloom is not ready." + : patchloomNeedsUpgrade(status) + ? "Patchloom CLI is older than this extension expects." + : "Patchloom is ready."; return [ - status.ready ? "Patchloom is ready." : "Patchloom is not ready.", + headline, status.message, `Source: ${describePatchloomSource(status.source)}`, status.version ? `Version: ${status.version}` : undefined, diff --git a/test/unit/binary.test.ts b/test/unit/binary.test.ts index 81f90c9..a212f69 100644 --- a/test/unit/binary.test.ts +++ b/test/unit/binary.test.ts @@ -30,6 +30,7 @@ import { clearManagedInstallFailure, clearManagedInstallFailureRecord, detectManagedInstallTarget, + unsupportedManagedInstallNotice, inspectManagedInstallStatus, loadManagedInstallFailure, ManagedInstallVerificationError, @@ -456,6 +457,17 @@ test("detectManagedInstallTarget maps supported platforms to release targets", ( assert.equal(detectManagedInstallTarget("linux", "arm"), undefined); }); +test("unsupportedManagedInstallNotice names linux/arm and opens settings", () => { + const notice = unsupportedManagedInstallNotice("linux", "arm"); + assert.equal( + notice.message, + "Managed install is not supported on this platform (linux/arm). Set patchloom.path to a Patchloom binary you already have." + ); + assert.match(notice.message, /linux\/arm/); + assert.equal(notice.actionTitle, "Open Settings"); + assert.equal(notice.actionCommand, "patchloom.openPatchloomSettings"); +}); + test("detectManagedInstallTarget selects musl target when isMusl is true", () => { assert.deepEqual(detectManagedInstallTarget("linux", "x64", true), { platform: "linux", diff --git a/test/unit/initializeProject.test.ts b/test/unit/initializeProject.test.ts index 8d5cba2..1bf89db 100644 --- a/test/unit/initializeProject.test.ts +++ b/test/unit/initializeProject.test.ts @@ -512,6 +512,21 @@ test("buildStatusDetails includes workspace readiness context", () => { assert.match(details, /AGENTS\.md: missing/); }); +test("buildStatusDetails opens with the upgrade warning when the CLI is unsupported", () => { + const details = buildStatusDetails({ + ready: true, + source: "path", + message: "Using Patchloom from PATH.", + binaryPath: "/usr/local/bin/patchloom", + version: "patchloom 0.0.9", + compatibility: "unsupported" + }); + + const firstLine = details.split("\n")[0]; + assert.equal(firstLine, "Patchloom CLI is older than this extension expects."); + assert.notEqual(firstLine, "Patchloom is ready."); +}); + test("preferredStatusAction points missing binary users to settings", () => { const action = preferredStatusAction( { diff --git a/walkthrough/install.md b/walkthrough/install.md index 77e0183..4644b99 100644 --- a/walkthrough/install.md +++ b/walkthrough/install.md @@ -3,7 +3,7 @@ Patchloom needs the CLI binary to work. Prefer channels that track GitHub Releases promptly (same day as the tag). -## Managed Install (Recommended on all platforms) +## Managed Install (Recommended download when a build exists) Click **Install Patchloom** above to download and install the CLI automatically. The extension handles download, checksum verification, From ec6090f18fb8e2c11c677d3ff9a18db033ee2cbe Mon Sep 17 00:00:00 2001 From: Sebastien Tardif Date: Mon, 23 Nov 2026 08:32:11 -0800 Subject: [PATCH 2/3] chore: bump fast-check to 4.11.0 The caret already allowed 4.11.0. The release adds optional assert plugins and allows a sync predicate on asyncProperty. Existing property tests still pass. Signed-off-by: Sebastien Tardif --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4f41a71..05445af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3126,9 +3126,9 @@ } }, "node_modules/fast-check": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.10.3.tgz", - "integrity": "sha512-SBaU6nhh+sXxb05r2IHAKfxnR/1Pu6MqtHYaewM1BY6V5xzOxOk+4yoWO7WfeeyZG1iArFE6/DO/7iLYMUuOJg==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.11.0.tgz", + "integrity": "sha512-V4Uc238rhQOdQlc+Gz7JG6SGBtrWnWL8d/6RyiBeCMcNKMhF6DZ0KkAVHJSyNV5r4lA0PmIpZ6iRpTVoz4qjoA==", "dev": true, "funding": [ { From 374367a6814c8f634dcd097824937bccab6c4e2f Mon Sep 17 00:00:00 2001 From: Sebastien Tardif Date: Mon, 23 Nov 2026 08:44:13 -0800 Subject: [PATCH 3/3] docs: correct the status action comment preferredStatusAction does not prefer managed install for every missing or outdated CLI. A setting or PATH binary opens Settings or Releases. The comment now matches the tested helper. Signed-off-by: Sebastien Tardif --- src/status/details.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/status/details.ts b/src/status/details.ts index 07b3cf2..b343549 100644 --- a/src/status/details.ts +++ b/src/status/details.ts @@ -60,7 +60,9 @@ export function statusNotificationSummary(ready: boolean, needsUpgrade: boolean) } export function preferredStatusAction(status: PatchloomStatus, workspaceReadiness?: WorkspaceReadiness): SetupAction | undefined { - // Missing or outdated CLI: shared remediation (managed install preferred). + // Missing or outdated CLI. Install or Update only when the managed + // binary is the one in use. A setting or PATH binary opens Settings + // or Releases, because those still win resolution order. if (!status.ready || patchloomNeedsUpgrade(status)) { return preferredBinaryRemediationAction(status); }