Before submitting
Area
apps/server
Steps to reproduce
-
Create a repo with an ignored directory:
mkdir repro && cd repro
git init
printf ".venv/\n" > .gitignore
mkdir -p .venv/lib
printf "ignored\n" > .venv/lib/test.txt
printf "tracked\n" > tracked.txt
git add .gitignore tracked.txt
-
Start T3 against that repo and select the repo root as the project root.
-
In the chat composer, type @.venv or search for test.txt.
-
Observe that the ignored path can appear in the picker / search results.
Expected behavior
Paths ignored by Git should not be returned by @ workspace search when the selected project root is inside a Git worktree and the repo's .gitignore excludes those paths.
Actual behavior
@ workspace search can include ignored files and directories.
The likely root cause is in apps/server/src/server.ts:183, where WorkspaceLayerLive is built like this:
const WorkspaceLayerLive = Layer.mergeAll(
WorkspacePathsLive,
WorkspaceEntriesLive.pipe(Layer.provide(WorkspacePathsLive)),
WorkspaceFileSystemLive.pipe(
Layer.provide(WorkspacePathsLive),
Layer.provide(WorkspaceEntriesLive.pipe(Layer.provide(WorkspacePathsLive))),
),
);
But WorkspaceEntries resolves Git through Effect.serviceOption(GitCore) in apps/server/src/workspace/Layers/WorkspaceEntries.ts:177:
const gitOption = yield* Effect.serviceOption(GitCore);
That same file only uses the Git-backed index when GitCore is present:
buildWorkspaceIndexFromGit(...) returns null when Option.isNone(gitOption) at apps/server/src/workspace/Layers/WorkspaceEntries.ts:199
buildWorkspaceIndex(...) then falls back to buildWorkspaceIndexFromFilesystem(...) at apps/server/src/workspace/Layers/WorkspaceEntries.ts:381
So the server appears to have the Git-aware implementation, but WorkspaceEntriesLive is not receiving GitCoreLive in this layer composition, which causes the Git-aware path to be disabled in practice.
The fix that worked locally was to wire GitCoreLive directly into WorkspaceEntriesLive and reuse that wired layer for WorkspaceFileSystemLive, for example:
const WorkspaceEntriesLayerLive = WorkspaceEntriesLive.pipe(
Layer.provide(WorkspacePathsLive),
Layer.provideMerge(GitCoreLive),
);
const WorkspaceFileSystemLayerLive = WorkspaceFileSystemLive.pipe(
Layer.provide(WorkspacePathsLive),
Layer.provide(WorkspaceEntriesLayerLive),
);
const WorkspaceLayerLive = Layer.mergeAll(
WorkspacePathsLive,
WorkspaceEntriesLayerLive,
WorkspaceFileSystemLayerLive,
);
Impact
Major degradation or frequent failure
Version or commit
3e07f5a
Environment
Linux, Runtime used during repro: Node 22.22.0, Installed CLI observed here: t3 0.0.17
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
There does not appear to be a clean repo-side workaround when this wiring bug is present.
The workaround that succeeded locally was to patch the installed runtime so WorkspaceEntriesLive is provided GitCoreLive, then restart the T3 server. After that change, ignored paths stopped appearing in @ workspace search.
Before submitting
Area
apps/server
Steps to reproduce
Create a repo with an ignored directory:
Start T3 against that repo and select the repo root as the project root.
In the chat composer, type
@.venvor search fortest.txt.Observe that the ignored path can appear in the picker / search results.
Expected behavior
Paths ignored by Git should not be returned by
@workspace search when the selected project root is inside a Git worktree and the repo's.gitignoreexcludes those paths.Actual behavior
@workspace search can include ignored files and directories.The likely root cause is in
apps/server/src/server.ts:183, whereWorkspaceLayerLiveis built like this:But
WorkspaceEntriesresolves Git throughEffect.serviceOption(GitCore)inapps/server/src/workspace/Layers/WorkspaceEntries.ts:177:That same file only uses the Git-backed index when
GitCoreis present:buildWorkspaceIndexFromGit(...)returnsnullwhenOption.isNone(gitOption)atapps/server/src/workspace/Layers/WorkspaceEntries.ts:199buildWorkspaceIndex(...)then falls back tobuildWorkspaceIndexFromFilesystem(...)atapps/server/src/workspace/Layers/WorkspaceEntries.ts:381So the server appears to have the Git-aware implementation, but
WorkspaceEntriesLiveis not receivingGitCoreLivein this layer composition, which causes the Git-aware path to be disabled in practice.The fix that worked locally was to wire
GitCoreLivedirectly intoWorkspaceEntriesLiveand reuse that wired layer forWorkspaceFileSystemLive, for example:Impact
Major degradation or frequent failure
Version or commit
3e07f5a
Environment
Linux, Runtime used during repro: Node
22.22.0, Installed CLI observed here:t30.0.17Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
There does not appear to be a clean repo-side workaround when this wiring bug is present.
The workaround that succeeded locally was to patch the installed runtime so
WorkspaceEntriesLiveis providedGitCoreLive, then restart the T3 server. After that change, ignored paths stopped appearing in@workspace search.