Repository navigation
[Bug]: Diff view drops intermediate directories for a nested git repo under a non-git project root #12902
Description
Activity
- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.Issue needs maintainer review and initial categorization.
on Sep 21, 2026 Triage
Confirmed as a path-mapping bug, not a bad local setup. Opening a file from the Diff panel for a git repo nested two or more levels under a non-git project root joins the wrong relative path to the project root.
Reported failure:
Failed to read workspace file 'kubernetes-pak-cl-dev/lms-platform/web/backoffice/values.yaml.gotmpl' in 'E:\Work\FinBeat'Expected location:
E:\Work\FinBeat\Kubernetes\kubernetes-pak-cl-dev\lms-platform\web\backoffice\values.yaml.gotmplThe
Kubernetes\segment between the project root and the clone is dropped. A clone sitting directly under the project root works, because<repo dir name>/<git-relative path>happens to be the full workspace-relative path.Diagnosis
The error string is
ProjectReadFileErrorinpackages/contracts/src/project.ts. Diff-panel open goes throughapps/web/src/components/DiffPanel.tsx→openDiffFilePrimaryAction/resolveDiffPathForWorkspaceinapps/web/src/diffFileActions.ts→rightPanelStore.openFile→project.readFilewithcwd= the project workspace root.resolveDiffPathForWorkspaceonly handles workspace inside repo: it strips the workspace prefix from a repo-relative path. When the repo is inside the workspace (this report),repositoryRelativeWorkspaceSegmentsreturnsnulland the path is used as-is. Git status, review diffs, and checkpoint numstat inapps/server/src/vcs/GitVcsDriverCore.ts/apps/server/src/orchestration/Layers/CheckpointReactor.tsare repository-relative.RepositoryIdentityResolveralso runsgit rev-parse --show-toplevelfrom the project cwd, so a non-git root has norepositoryIdentity.rootPathfor the UI to recover the full offset.That matches the reporter’s construction:
<repo dir name>/<path relative to the repo root>joined onto the project root.This is the inverse of #2441 / #9842 (workspace subdirectory of a git repo). Those fixes do not cover a non-git parent with clones underneath.
#9816 is the open multi-repo Diff-panel feature for this layout (
t3.jsonrepositories). Review there already flagged nested-repository path resolution. It is not merged and should not be treated as a fix for 0.0.42.Next step
Small, targeted fix plus a regression test:
- When
repositoryRootis underworkspaceRoot, build the workspace path asrelative(workspaceRoot, repositoryRoot)+ the git-relative file path, keeping every intermediate directory (notbasename(repoRoot)). - Cover the Windows fixture
E:\Work\FinBeat\Kubernetes\kubernetes-pak-cl-dev\lms-platform\web\backoffice\values.yaml.gotmpl. - Keep #9816 in the loop so the multi-repo Diff work uses the same offset.
Until that lands, the existing workaround stands: open the nested clone as its own T3 Code project, or inspect the change with
git diffin the terminal.Not a duplicate. Repro is sufficient to implement; no extra reporter info needed.
- When
- addedvia-triageFiled through npx t3 triageFiled through npx t3 triageand removedneeds-triageIssue needs maintainer review and initial categorization.Issue needs maintainer review and initial categorization.
on Sep 21, 2026 Hi, I'd like to take this one.
I'd follow the next step above: when the repo is under the workspace, build the path from
relative(workspaceRoot, repositoryRoot)plus the git-relative path instead of the repo basename, with the Windows fixture as a regression test. I'll keep it small so #9816 can reuse the same offset.Happy to hold off if you'd rather handle it yourselves.
Before submitting
Area
apps/desktop
Steps to reproduce
E:\Work\FinBeat.E:\Work\FinBeat\Kubernetes\kubernetes-pak-cl-dev\.git.Kubernetes/kubernetes-pak-cl-dev/lms-platform/web/backoffice/values.yaml.gotmpl.Expected behavior
The diff opens; the file is resolved as
<project root>/Kubernetes/kubernetes-pak-cl-dev/lms-platform/web/backoffice/values.yaml.gotmpl.Actual behavior
Error:
Failed to read workspace file 'kubernetes-pak-cl-dev/lms-platform/web/backoffice/values.yaml.gotmpl' in 'E:\Work\FinBeat'.The path is built as
<repo dir name>/<path relative to the repo root>and joined to the project root. The intermediateKubernetes/segment between the project root and the repository is lost, so the file does not exist at the resolved location. Works fine when the repo sits directly under the project root (one level deep).Impact
Major degradation or frequent failure
Version or commit
T3 Code (Alpha) 0.0.42, Windows desktop build
Environment
Windows 11 Pro 10.0.22621, desktop app, Claude Code harness. Project root is a plain folder (no
.git); git repos live at<root>/Kubernetes/<name>/.git.Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
Open the nested repo folder as a separate T3 Code project, or read the diff via
git diffin the terminal