Repository navigation
[NO-TICKET] Finish setup with the newest version a project accepts - #467
Merged
Merged
Conversation
pnpm 11 and later skip a package version published in the last day, so the release `npx` just fetched is often refused when setup adds itself. Setup then stopped before writing anything, and the assistant running it could still report success. When the exact version is refused, setup now lets the package manager add the newest version it allows and hands over to that version's own setup with the same arguments, so the files written match the installed package. If that fails too, the output ends on a plain line saying setup did not finish. Both are disclosed in README.md and AGENT-INSTALL.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
/review |
|
🎯 Elite quality (98%) — Adds a pnpm-maturity fallback that installs the newest allowed version and hands setup over to it. 📦 Medium |
devlob
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No ticket.
What changed
setupnow finishes in projects that only accept package versions older than a day. That is the default in pnpm 11 and later, and v0 projects use pnpm 12.setup, with the same arguments. The person sees one line: "This project accepts @patchstack/connect 0.5.72, not 0.5.75, so setup continues with 0.5.72."Projects that accept the running version behave exactly as before.
Why
npx @patchstack/connect setupruns the newest release. Setup then adds that exact version to the project, so the files it writes match the package the app imports. pnpm 11+ refuses any version published in the last day (ERR_PNPM_NO_MATURE_MATCHING_VERSION), and we often release more than once a day. So in a pnpm 11+ project, setup usually failed at its very first step.When it failed, setup stopped before writing anything: no dependency, no config, no widget, no guard, no summary and no link to connect the account. The error could scroll past in the install log. In a v0 chat, the assistant then told the person "setup completed successfully". The person was left with no widget and no claim link.
Earlier v0 installs only worked because the assistant improvised: it added
@patchstack/connect@<version>tominimumReleaseAgeExcludeinpnpm-workspace.yaml. Setup doesn't do that itself. It would switch off a safety setting the person chose, for our package, and agents treat that kind of change as a warning sign.Fix
src/cli.ts, setup's install step:installSelf(..., null)), so the package manager picks the newest version it allows.installedCli,runInstalledSetupinsrc/bootstrap.ts) withprocess.argv.slice(2)and return its exit code. The running setup stops there, so only one version writes files.SETUP_NOT_FINISHED(src/report.ts) when an assistant is reading.tests/execution-disclosure.test.ts(src/bootstrap.tsspawnSync, 1 → 2).README.mdandAGENT-INSTALL.mdsay when setup does this, in the paragraph that already discloses the install, and in AGENT-INSTALL'ssetuprow.Verified
minimumReleaseAge: 1440inpnpm-workspace.yaml, and Patchstack pointed at a dead local address so nothing was sent:pnpm add @patchstack/connect@0.5.75fails withERR_PNPM_NO_MATURE_MATCHING_VERSION. That is the old behaviour, and what happened in v0."^0.5.72"inpackage.json), and 0.5.72's setup takes over.tests/bin-invocation.test.ts, two new tests with a stand-inpnpm. Both fail on the previous code.@patchstack/connect@<version>but installs an older stand-in: setup says which version it continues with, the stand-in's CLI receivessetup --widget, and the newer setup writes nothing.npm run typecheck,npm run buildandcapabilities:checkare green.npm test: 4662 passed, 7 skipped. One test failed: "stays a small multiple of the same rewrite on text that is not JSON" is a timing test, and passes on its own (12/12).Out of scope, worth a follow-up
Docs:
README.mdandAGENT-INSTALL.mddisclose the fallback. Agents audit these, so the hostile field test is owed after the release that carries this, plusstandard/lovablefor doc accuracy.🤖 Generated with Claude Code