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(server): file search keeps symlinks when a link's name looks like a git pathspec - #42436
When a symlink directly in a repository root (or nested repo root) has a name Git parses as pathspec magic, such as :(link), git check-ignore --no-index -z --stdin exits 128 for the whole batch (fatal: Invalid pathspec magic 'link' in ':(link)'). WorkspaceSearchIndex then treats every symlink in that repository as ignored, hiding all of them from file search (composer @ mentions and quick open).
Change
Because fff skips symlinks, WorkspaceSearchIndex checks their ignore status itself in listGitIgnored (apps/server/src/workspace/WorkspaceSearchIndex.ts). I prefixed each repository-relative stdin path with ./ (pathspec magic only applies to a leading :) and stripped ./ from Git's echoed output before prepending the repository folder. This covers :!x, :^x, and :(glob)*, which exit 128 the same way, as well as plain :link, which Git reads as link and answers wrong in either direction whenever the two have different ignore rules. --literal-pathspecs, GIT_LITERAL_PATHSPECS, and :(literal) are not options because git check-ignore rejects them for every path (exit 128: pathspec magic not supported by this command: 'literal'). The paths are already POSIX (joinEntryPath), and this is the same ./-prefixed stdin input #42333 already sends from WorkspaceEntries.ts on main. In apps/server/src/workspace/WorkspaceSearchIndex.test.ts, I added one git-backed symlink test next to the non-git symlink tests. The test stages ignored-link with git add -f so only listGitIgnored can hide it, which also catches a missing ./ strip.
Scope
Bug fix for wrong data (symlinks missing from file search). No issue: this is a small fix for an obvious bug where one symlink name at a repository root hides every symlink in that repository.
Verification
Steps (Linux):git init demo-project, add .gitignore (ignored-link), create README.md, notes.md, docs/guide.md, and symlinks docs-link -> docs, :(link) -> notes.md, ignored-link -> notes.md → add the folder as a project → new thread → type @link in the composer.
Setup: Linux (Ubuntu 26.04), web client in T3's built-in browser panel, light theme, 1280x800 viewport, fresh isolated dev data per commit (vp run dev --no-seed), synthetic demo repo, server named "Test machine".
@link lists only .gitignore; docs-link and :(link) are missing
@link lists :(link) and docs-link; the gitignored ignored-link stays hidden
Tests (Node 26.13.1): On 54ba240, the new symlink test fails (1 failed | 17 passed); on 2b85ab5, WorkspaceSearchIndex.test.ts passes 18/18 three times (and fails if the ./ strip is removed) and vp run check:changed passes.
Merged tree: 2b85ab5's parent is 54ba240, the newest green upstream main when checked (33 success, 50 skipped, 0 failed), and later main commits do not touch these files or the lockfile.
Test output
# 54ba240 — WorkspaceSearchIndex.test.ts on base source
FAIL |t3| src/workspace/WorkspaceSearchIndex.test.ts > keeps symlinks Git does not ignore when a link's name looks like a git pathspec
AssertionError: expected [] to deeply equal [ ':(link)', 'docs-link' ]
- Expected
+ Received
- [
- ":(link)",
- "docs-link",
- ]
+ []
Test Files 1 failed (1)
Tests 1 failed | 17 passed (18)
# 2b85ab5 run 1
Test Files 1 passed (1)
Tests 18 passed (18)
# 2b85ab5 run 2
Test Files 1 passed (1)
Tests 18 passed (18)
# 2b85ab5 run 3
Test Files 1 passed (1)
Tests 18 passed (18)
# 2b85ab5 check:changed
check:changed summary
pass format 0.2s
pass lint 0.3s
pass knip 1/2 8.0s
pass knip 2/2 13.6s
pass graphql (apps/server) 0.4s
pass typecheck (3 packages) 10.0s
pass test (2 files) 12.4s
CI also runs: full test suites, build
unused patch check skipped: no dependency files changed
Not checked: Windows and macOS (: is illegal in Windows filenames; the new test skips win32); desktop and mobile clients (same server search; no client code changed); nested repos in the app (same per-repo path with repo-relative paths).
Reviewing files that changed from the base of the PR and between 2b85ab5 and 650a294.
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 workspace search index now prefixes paths with ./ when checking Git ignore status and removes the prefix from returned paths. A non-Windows regression test covers symlinks with pathspec-like names.
Changes: Git-ignore path handling
Layer / File(s)
Summary
Ignore-check path handling and regression test apps/server/src/workspace/WorkspaceSearchIndex.ts, apps/server/src/workspace/WorkspaceSearchIndex.test.ts
listGitIgnored prefixes submitted paths with ./ and removes that prefix from returned paths. A non-Windows test checks that pathspec-like symlinks remain listed unless Git ignores them, including a force-staged ignored symlink.
This change stops symlinks with pathspec-like names from disappearing from file search. The change is small and has a regression test. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(server): file search keeps symlinks when a link's name looks like a git pathspec" matches the main change. The PR prefixes repo-relative paths with './' before calling git check-ignore,…
Description check
The description covers the problem, the change, scope, and verification. It follows the template sections: Problem, Change, Scope, Verification. The Problem section explains the failure and its impact…
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 "fix(server): file search keeps symlinks when a link's name looks like a git pathspec" matches the main change. The PR prefixes repo-relative paths with './' before calling git check-ignore, so symlinks named like pathspec magic (e.g. ':(link)') are no longer hidden from file search. The title is specific and follows conventional commit format. It is 84 characters, which is somewhat long but acceptable.
Full details: Description check
Explanation
The description covers the problem, the change, scope, and verification. It follows the template sections: Problem, Change, Scope, Verification. The Problem section explains the failure and its impact. The Change section explains the './' prefix approach and why alternatives such as --literal-pathspecs were rejected. The Scope section states this is a bug fix and explains why no issue is linked. The Verification section gives concrete steps, before/after screenshots, and test output, and it lists what was not checked (Windows, macOS, desktop, mobile). The template's closing line about naming the model and harness is satisfied by 'Generated with Gemini 4 Neon in T3 Code Nightly'. The description is thorough, and the only possible gap is that the Scope section does not link an issue, but the author explains why none is needed.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Created three synthetic Git repositories with committed notes.md, docs/guide.md, and .gitignore ignoring ignored-link. Added untracked symlinks as reported, opened a Replay thread in each, and typed @link. Real web app, Chromium, light theme, 1280×900, fresh database per commit.
Proven: base loses eligible symlinks only when :(link) exists; head shows both eligible symlinks and continues hiding ignored-link. The scenario runner exited 0.
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:S10-29 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.
Problem
When a symlink directly in a repository root (or nested repo root) has a name Git parses as pathspec magic, such as
:(link),git check-ignore --no-index -z --stdinexits 128 for the whole batch (fatal: Invalid pathspec magic 'link' in ':(link)').WorkspaceSearchIndexthen treats every symlink in that repository as ignored, hiding all of them from file search (composer@mentions and quick open).Change
Because
fffskips symlinks,WorkspaceSearchIndexchecks their ignore status itself inlistGitIgnored(apps/server/src/workspace/WorkspaceSearchIndex.ts). I prefixed each repository-relative stdin path with./(pathspec magic only applies to a leading:) and stripped./from Git's echoed output before prepending the repository folder. This covers:!x,:^x, and:(glob)*, which exit 128 the same way, as well as plain:link, which Git reads aslinkand answers wrong in either direction whenever the two have different ignore rules.--literal-pathspecs,GIT_LITERAL_PATHSPECS, and:(literal)are not options becausegit check-ignorerejects them for every path (exit 128:pathspec magic not supported by this command: 'literal'). The paths are already POSIX (joinEntryPath), and this is the same./-prefixed stdin input #42333 already sends fromWorkspaceEntries.tson main. Inapps/server/src/workspace/WorkspaceSearchIndex.test.ts, I added one git-backed symlink test next to the non-git symlink tests. The test stagesignored-linkwithgit add -fso onlylistGitIgnoredcan hide it, which also catches a missing./strip.Scope
Bug fix for wrong data (symlinks missing from file search). No issue: this is a small fix for an obvious bug where one symlink name at a repository root hides every symlink in that repository.
Verification
Steps (Linux):
git init demo-project, add.gitignore(ignored-link), createREADME.md,notes.md,docs/guide.md, and symlinksdocs-link -> docs,:(link) -> notes.md,ignored-link -> notes.md→ add the folder as a project → new thread → type@linkin the composer.Setup: Linux (Ubuntu 26.04), web client in T3's built-in browser panel, light theme, 1280x800 viewport, fresh isolated dev data per commit (
vp run dev --no-seed), synthetic demo repo, server named "Test machine".@link lists only .gitignore; docs-link and :(link) are missing
@link lists :(link) and docs-link; the gitignored ignored-link stays hidden
Tests (Node 26.13.1): On
54ba240, the new symlink test fails (1 failed | 17 passed); on2b85ab5,WorkspaceSearchIndex.test.tspasses 18/18 three times (and fails if the./strip is removed) andvp run check:changedpasses.Merged tree: 2b85ab5's parent is 54ba240, the newest green upstream main when checked (33 success, 50 skipped, 0 failed), and later main commits do not touch these files or the lockfile.
Test output
Not checked: Windows and macOS (
:is illegal in Windows filenames; the new test skipswin32); desktop and mobile clients (same server search; no client code changed); nested repos in the app (same per-repo path with repo-relative paths).Who tested: An AI agent ran every check.
Generated with Gemini 4 Neon in T3 Code Nightly