From 22fe00071538af5c3221bd3edb6eb4c65eafa70e Mon Sep 17 00:00:00 2001 From: Gregory Boch Date: Mon, 12 Oct 2026 11:09:07 +0200 Subject: [PATCH] fix(cli): agent hints run @prisma/cli@latest, not the stale next tag The post-login skills tip and the PROJECT.DELETE_BLOCKED next action print `npx -y @prisma/cli@next ...`. Since the 2026-08-25 cutover the RC line publishes on `latest` and the publish path no longer moves `next` (docs/oss/versioning.md), so those hints install an older RC. Co-Authored-By: Claude Opus 5.5 --- packages/cli/src/cli-command.ts | 7 ++-- packages/cli/tests/cli-command.test.ts | 48 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 packages/cli/tests/cli-command.test.ts diff --git a/packages/cli/src/cli-command.ts b/packages/cli/src/cli-command.ts index ea12136d..9da7b8e9 100644 --- a/packages/cli/src/cli-command.ts +++ b/packages/cli/src/cli-command.ts @@ -1,10 +1,9 @@ import { CLI_NAME } from "./cli-name"; export const PRISMA_CLI_PACKAGE_NAME = "@prisma/cli"; -// `next` is the RC line's canonical dist-tag (docs/oss/versioning.md); -// `latest` still serves the 3.x beta until the deliberate cutover, so a -// hint spelling `@latest` would bounce users into the pre-8 command set. -export const PRISMA_CLI_PACKAGE_SPEC = `${PRISMA_CLI_PACKAGE_NAME}@next`; +// `latest` carries the RC line since the 2026-08-25 cutover; the publish +// path no longer moves `next` (docs/oss/versioning.md). +export const PRISMA_CLI_PACKAGE_SPEC = `${PRISMA_CLI_PACKAGE_NAME}@latest`; export const DEFAULT_PRISMA_CLI_PACKAGE_RUNNER = ["npx", "-y"]; export const PRISMA_CLI_BINARY = CLI_NAME; diff --git a/packages/cli/tests/cli-command.test.ts b/packages/cli/tests/cli-command.test.ts new file mode 100644 index 00000000..a663de20 --- /dev/null +++ b/packages/cli/tests/cli-command.test.ts @@ -0,0 +1,48 @@ +/** + * The package spec the CLI prints in its own hints. `latest` carries the + * RC line since the 2026-08-25 cutover and the publish path no longer + * moves `next` (docs/oss/versioning.md), so a hint spelling `@next` + * installs a release that lags the current one. + */ +import { describe, expect, it } from "vitest"; + +import { + formatPrismaCliCommand, + PRISMA_CLI_PACKAGE_SPEC, +} from "../src/cli-command"; +import { projectDeleteBlockedError } from "../src/lib/project/provider"; + +describe("formatPrismaCliCommand", () => { + it("runs the package from the latest dist-tag", () => { + expect(PRISMA_CLI_PACKAGE_SPEC).toBe("@prisma/cli@latest"); + expect(formatPrismaCliCommand(["skills", "sync"])).toBe( + "npx -y @prisma/cli@latest skills sync", + ); + }); + + it("keeps the spec with a detected package runner", () => { + expect( + formatPrismaCliCommand(["skills", "sync"], { + packageRunner: ["pnpm", "dlx"], + }), + ).toBe("pnpm dlx @prisma/cli@latest skills sync"); + }); + + it("uses the binary name when asked for the binary", () => { + expect( + formatPrismaCliCommand(["skills", "sync"], { invocation: "binary" }), + ).toBe("prisma skills sync"); + }); +}); + +describe("projectDeleteBlockedError", () => { + it("suggests a service delete command that runs the latest package", () => { + const error = projectDeleteBlockedError("proj_1", undefined); + + expect(error.nextActions).toContainEqual({ + kind: "run-command", + label: "npx -y @prisma/cli@latest service delete --service ", + command: "npx -y @prisma/cli@latest service delete --service ", + }); + }); +});