You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cli): npx no longer skips the install offer for a directory or non-runnable t3 on PATH - #41402
npx t3 offers to install the t3 command unless one is already installed. It counted any path named t3 as installed, so a directory named t3 or a non-executable t3 file on PATH (or at ~/.t3/bin/t3) hid the offer for good.
offerCliInstall now uses the same runnable-file check (resolveCommandPath) that the shadow check in installCli got in #37903: a regular file that is executable on POSIX, or that has a PATHEXT extension on Windows. Recorded launcher paths must also be absolute, as the other readers of the launchers file already require, so a stray bare line cannot turn into a PATH search.
Evidence
An AI agent ran each check below on Linux (x64), with an isolated HOME, no accounts and no network.
Setup: I built the single-executable t3 (vp run build:exe in apps/server) at main (d63b9c4) and at this branch. I placed each one as the standalone runtime at $HOME/.t3/runtime/versions/0.1.11/t3 and set T3CODE_NPM_LAUNCHER_PATH to a launcher under an _npx cache, so it runs as npx t3 does. I ran it in a pty, with PATH=<dir>:/usr/bin:/bin.
Steps: for each case, put the listed t3 in <dir>, run t3 project and check whether the install prompt appears.
t3 in <dir> on PATH
main
This PR
none (control)
prompts
prompts
directory
no prompt
prompts
non-executable file (-rw-r--r--)
no prompt
prompts
executable file (control)
no prompt
no prompt
=== main, t3 directory on PATH
$ PATH=<dir>:/usr/bin:/bin npx-launched t3 project
[prompt shown: False]
=== this PR, t3 directory on PATH
$ PATH=<dir>:/usr/bin:/bin npx-launched t3 project
? Install the t3 command? Then you can run `t3` directly. › (Y/n)
[prompt shown: True]
=== this PR, executable t3 on PATH
$ PATH=<dir>:/usr/bin:/bin npx-launched t3 project
[prompt shown: False]
Test:install.test.ts now asserts that a t3 directory and a non-executable t3 on PATH still ask. It also makes the existing runnable-t3 control executable, and adds a bare t3 launcher record to the runner-.bin case. Against main's install.ts it fails at the new assertion (expected true to be false). It passes with the fix. vp run check:changed passes.
Not shown: Windows and macOS runs. The Windows path uses resolveCommandPath's existing PATHEXT check, the same one the shadow check uses.
Reviewing files that changed from the base of the PR and between 1df56f6 and ecbc32a.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The install offer now checks absolute launcher-file entries with resolveCommandPath. Tests verify that only executable t3 files suppress the offer.
Changes: CLI install offer
Layer / File(s)
Summary
Resolve runnable t3 candidates apps/server/src/cli/install.ts, apps/server/src/cli/install.test.ts
The install offer filters launcher-file entries to absolute paths and checks candidates with resolveCommandPath. Tests cover executable files, directories, non-executable files, and runner launcher entries.
The change makes the install offer appear when PATH holds a directory or non-executable file named t3, instead of being wrongly suppressed. It is tested and low risk to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the fix and the affected area: npx no longer skips the install offer when a directory or non-runnable t3 is on PATH. This matches the changeset, which switches offerCliInstall to the r…
Description check
The description follows the template. It states the problem and the change. Scope links a prior PR (#37903) for the shadow check, and the description gives a bug-fix rationale. Verification gives focu…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the fix and the affected area: npx no longer skips the install offer when a directory or non-runnable t3 is on PATH. This matches the changeset, which switches offerCliInstall to the resolveCommandPath runnable-file check and requires absolute launcher paths. It uses the conventional commit format and is specific, so it reads clearly in history.
Full details: Description check
Explanation
The description follows the template. It states the problem and the change. Scope links a prior PR (#37903) for the shadow check, and the description gives a bug-fix rationale. Verification gives focused tests, a manual before-and-after table, observed results, and what was not checked (Windows and macOS). It also names the model and harness used, as the template asks. The Scope section does not link a tracked issue, and it does not explain why no issue is needed for this fix. The description uses headings that differ from the template, with 'Evidence' in place of 'Problem' and 'Change' in a different order, and it has no explicit Problem or Scope heading.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 1e088be and 1df56f6.
Files selected for processing: 2
apps/server/src/cli/install.test.ts
apps/server/src/cli/install.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Ran the real standalone CLI through its npm launcher on Linux x64 in matching foreground PTYs, with fresh HOME for every case. Invoked node <npx-cache>/node_modules/t3/bin/t3.mjs project with: no candidate, a PATH directory named t3, a PATH file mode 0644, a PATH file mode 0755, and a bare t3 launcher record plus a working-directory t3 directory. Answered each offered installation with n + Enter.
Base incorrectly skipped the offer for the directory, mode-0644 file and bare launcher record. Head offered installation for all three. Both controls remained correct.
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
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
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.
npx t3offers to install thet3command unless one is already installed. It counted any path namedt3as installed, so a directory namedt3or a non-executablet3file onPATH(or at~/.t3/bin/t3) hid the offer for good.offerCliInstallnow uses the same runnable-file check (resolveCommandPath) that the shadow check ininstallCligot in #37903: a regular file that is executable on POSIX, or that has aPATHEXTextension on Windows. Recorded launcher paths must also be absolute, as the other readers of thelaunchersfile already require, so a stray bare line cannot turn into aPATHsearch.Evidence
An AI agent ran each check below on Linux (x64), with an isolated
HOME, no accounts and no network.Setup: I built the single-executable
t3(vp run build:exeinapps/server) atmain(d63b9c4) and at this branch. I placed each one as the standalone runtime at$HOME/.t3/runtime/versions/0.1.11/t3and setT3CODE_NPM_LAUNCHER_PATHto a launcher under an_npxcache, so it runs asnpx t3does. I ran it in a pty, withPATH=<dir>:/usr/bin:/bin.Steps: for each case, put the listed
t3in<dir>, runt3 projectand check whether the install prompt appears.t3in<dir>onPATHmain-rw-r--r--)Test:
install.test.tsnow asserts that at3directory and a non-executablet3onPATHstill ask. It also makes the existing runnable-t3control executable, and adds a baret3launcher record to the runner-.bincase. Againstmain'sinstall.tsit fails at the new assertion (expected true to be false). It passes with the fix.vp run check:changedpasses.Not shown: Windows and macOS runs. The Windows path uses
resolveCommandPath's existingPATHEXTcheck, the same one the shadow check uses.🤖 Generated with Gemini 4 Neon in T3 Code Nightly