Skip to content

fix(cli): ignore non-executable paths when checking installation - #37903

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
Lucenx9:fix/cli-install-non-executable-shadow
Nov 17, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
Lucenx9:fix/cli-install-non-executable-shadow

Conversation

@Lucenx9

@Lucenx9 Lucenx9 commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Problem

t3 install treats any earlier path named t3 as a command that shadows the installed launcher. A directory or a regular file without execute permissions therefore produces an incorrect warning and suppresses the PATH setup hint, although the shell skips it.

Found by comparing the install result with native /bin/sh lookup in an isolated temporary T3 home.

Change

Use the existing shared command resolver for each explicit candidate instead of checking existence. Extend the existing installation test with an earlier directory; make its genuine executable control executable.

Scope

Small correction to CLI installation diagnostics, qualifying for the obvious-bug exception without a prior issue. Two files. The separate desktop path already received its own executable check in merged #22046; this fixes the CLI path introduced by #33150. Targeted searches found no competing CLI fix.

Verification

The runtime replay calls the actual installer, then /bin/sh selects and executes t3. All writes are confined to a temporary home.

Earlier PATH entry Native shell runs Before: CLI reports shadow After: CLI reports shadow
Non-executable file Installed launcher Yes No
Directory Installed launcher Yes No
Executable file Earlier command Yes Yes
  • Regression with baseline source fails at assert.isTrue(directory.onPath); fixed module: 3/3 tests pass.
  • vp run check:changed --concurrency 1: passed, including 3 affected typechecks and 5 tests across 2 files. Normal commit hooks passed (format, lint, Knip).
  • Additional bounded checks against the real installer and native shell: fast-check 80 cases; Jazzer.js reproduces the baseline failure and passes 200 fixed runs. Cases include executable/non-executable files, directories, missing paths and symlinks, with the install directory present or absent from PATH.
  • StrykerJS: 2/3 mutants killed. The survivor removes the explicit environment option and falls back to the same injected environment, making it equivalent in this harness.
  • Fallow: sparse two-file audit and review validation passed; inherited findings remain. CodeScene reported a failed quality gate because the existing enclosing test factory grows from 204 to 211 lines (threshold 70); it reported no production-file degradation. Kept the focused regression in its existing case as the repository requests.

Local execution: Linux, Node 24.15, one CPU worker. No native macOS/Windows or desktop session was run.

Independent reviews: GPT-6.1 Sol high and Grok 4.7 Fast high each approved in one read-only round with no actionable findings. Both accepted the disclosed CodeScene test-length advisory.

Authored with GPT-6.1 Sol in the Codex harness through T3 Code.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 04:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T04:09:26.141671Z 2f5c08d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 17, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 2f5c08d

Macroscope's review found this PR approvable — Installation checks now ignore non-executable paths when determining whether another t3 command takes precedence. The change affects status and PATH guidance while leaving launcher installation safeguards unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2f5c08d and 4178c7c.

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 installer now uses command resolution to check whether an earlier PATH entry shadows the installed command. The test covers an executable file that shadows the command and a directory that does not.

Changes: PATH command resolution

Layer / File(s) Summary
Resolve PATH shadowing
apps/server/src/cli/install.ts, apps/server/src/cli/install.test.ts
The installer uses resolveCommandPath with the current environment to find a shadowing command. The test verifies that an executable file shadows the installed command, while a directory does not.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: t3dotgg, macroscopeapp

Merge Risk: Minimal · previous review 2f5c0

The installer's PATH check now ignores directories and non-executable files while still detecting executable commands that shadow the installed one. The change is small, covered by a regression test, and I found no remaining merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the CLI installation check now ignores non-executable paths. It follows the conventional commit format and matches the raw summary, the PR objectives, and the descript…
Description check Passed The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each one has concrete content. The Problem section explains the bug and the reproduction …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the CLI installation check now ignores non-executable paths. It follows the conventional commit format and matches the raw summary, the PR objectives, and the description. The title is specific and accurate.

Full details: Description check

Explanation

The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each one has concrete content. The Problem section explains the bug and the reproduction method. The Change section explains the fix. The Scope section cites the obvious-bug exception and links related PRs. The Verification section gives focused tests, a results table, and the environment limits. The author also states the model and harness used, as the template asks. The description does not link a GitHub issue, but it explains why none is needed, which the template allows.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d7373c4 and 2f5c08d.

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; 9 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 17, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Ran the real standalone installer on Linux x86_64/Bash with fresh synthetic homes: no earlier candidate; directory and mode-644 file before the installed bin; both candidates with bin absent from PATH; and a genuine mode-755 executable shadow. After each install, ran t3 --version through Bash under the same PATH.

Base falsely reports directories and non-executable files as running first and suppresses missing-PATH guidance. Head skips them, reports startup or PATH setup guidance appropriately, and preserves the genuine executable-shadow warning. Both controls behave correctly. Images render captured command output, with synthetic sandbox paths normalized to $DEMO.

Before After
e9d5bae5cf 4178c7c5e0
Before: false shadow warnings and missing PATH guidance After: correct startup and PATH guidance, executable shadow preserved

Reproduction driver · Before transcript · After transcript

Not shown:

  • Windows command-resolution behavior was not exercised; this proof covers the reported Linux/Bash reproduction.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 17, 2026
@juliusmarminge
juliusmarminge merged commit 77fe1d6 into pingdotgg:main Nov 17, 2026
57 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 17, 2026
cursor Bot pushed a commit to mattiaz9/t3code that referenced this pull request Nov 17, 2026
…gdotgg#37903)

Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants