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(web): PR description file links resolve in the PR's repository from a No-project thread - #41073
Clicking a repo-relative file path in a linked pull request's description from a 'No project' thread opened a broken tab that looked for the file in the thread's scratch folder. The description renders in the PR's own checkout, but its file links gave the file panel a path relative to that checkout, and the panel reads relative paths from the thread's folder. Links in markdown rendered in a folder other than the thread's own now open the absolute path under that folder. Ordinary chat links are unchanged.
Commit 324ac49 (origin/main), web dev server with T3CODE_DEV_SEED=0 and a --home-dir outside any git checkout. Without that, the No project option is hidden because scratch is disabled when the data dir is inside a repo. Fixtures: a git repo repo-a (origin https://github.com/pingdotgg/t3code.git) holding packages/client-runtime/src/state/filesystem.ts, and a folder home holding dev/repo-a plus a second copy at backup/repo-a/packages/client-runtime/src/state/filesystem.ts. Both were added with t3 project add (repo-a, then home). Created a No-project thread with the free Replay provider (cwd /scratch/2026-11-22-go-93b2964d). Linked #28243 through the command palette's 'Link pull request to thread'; its description has inline code packages/client-runtime/src/state/filesystem.ts, rendered as a filesystem.ts file chip. Clicking the chip in the PR Summary tab opened a file tab with breadcrumb 'No project > packages > client-runtime > src > state > filesystem.ts' and 'The file could not be accessed or read. It may be missing or inaccessible. Attempted path /scratch/2026-11-22-go-93b2964d/packages/client-runtime/src/state/filesystem.ts. Workspace folder: /scratch/2026-11-22-go-93b2964d.' This matches the report. Control: with the backup copy moved out of home, a reload and the same click opened /home/dev/repo-a/packages/client-runtime/src/state/filesystem.ts correctly. Restoring the copy brought the failure back on a fresh load, so it fails every time whenever a second project lists a different file with the same repo-relative suffix.
Evidence
Web client, Chromium 156 on Linux, 1280×800, light theme. Both commits used fresh isolated state, native No-project scratch outside Git, and the free Replay provider.
Steps: register repo-a with the target file and the PR repository's origin; register Home with a different backup file at the same repo-relative suffix; start a No-project thread; link #28243; open Summary and click filesystem.ts.
vp test run apps/web/src/components/ChatMarkdown.browser.test.tsx -t "another checkout" with the base ChatMarkdown.tsx: fails as expected (received packages/state/filesystem.ts)
vp test run apps/web/src/components/ChatMarkdown.browser.test.tsx -t "workspace file opens": 6 passed
vp test run apps/web/src/components/ChatMarkdown.browser.test.tsx apps/web/src/components/ChatMarkdown.permissions.browser.test.tsx: 2 files, 63 tests passed
vp run check:changed: pass (format, lint, knip, typecheck of 2 packages, tests, react compiler)
Manual run in the web app (dev server, fresh home, repo-a and Home registered, No-project Replay thread, PR fix(web): Tab completes folder names in the add-project browser #28243 linked): clicking the filesystem.ts chip in the PR Summary now opens repo-a's file instead of the missing scratch path
When the server cannot match the PR's repository to any registered project, the description renders in the thread's own folder. A repo-relative path that two other projects contain as different files is still left unresolved there.
ChatMarkdown's other panel opens (skill links and media 'open file') still pass paths unchanged and were not checked for markdown rendered outside the thread's folder.
Who did the work
Written by Claude Opus 5.5, in Claude Code
Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5
…om a No-project thread
A repo-relative path in a linked pull request's description gave up when
another project held a different file at the same path, and opened a
broken tab under the thread's scratch folder. An ambiguous cross-project
match now retries among the projects whose repository is the PR's.
Fixes#41065
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No actionable comments were generated in the recent review.
Walkthrough
ChatMarkdown now determines the thread’s panel root from its worktree or matching project. When that root differs from the message working directory, it resolves the opened path against the working directory. A browser test checks this behavior for a thread with a scratch worktree.
Changes: Workspace-aware markdown file opening
Layer / File(s)
Summary
Panel root and path resolution apps/web/src/components/ChatMarkdown.tsx, apps/web/src/components/ChatMarkdown.browser.test.tsx
ChatMarkdown selects a panel root from the thread worktree or matching project. When the root and cwd differ, it resolves the path against cwd. The browser test checks that a relative markdown link opens under /repo-a when the thread has a /scratch/thread worktree.
Repo-relative file links in a PR description opened from a scratch thread now resolve against the PR repository's checkout. No concrete merge-blocking risk remains in the reviewed change.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
Directly linked issue #41065 asks that a repo-relative file link in a linked PR description, opened from a 'No project' scratch thread, resolve against the PR's repository (Option A: registered projec…
Provide readable diff hunks for apps/web/src/components/ChatMarkdown.tsx and packages/client-runtime/src/workspaceBasenameLookup.ts (or confirm whether the latter changed) at head c3bf1c5 against merge base c89ca0a. Confirm that the matchin…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title names the fix and its scope: PR description file links resolving in the PR's repository from a No-project thread. The raw summary and PR objectives both describe repository-preferred resolut…
Out of Scope Changes check
The visible change summary lists only apps/web/src/components/ChatMarkdown.tsx (+17/-1) and apps/web/src/components/ChatMarkdown.browser.test.tsx (+33/-0). The source change resolves file links in the…
Description check
The description covers the problem, the change, scope, and verification in detail. The Problem section explains the broken tab from a No project thread, and the Change section explains that links rend…
Full details: Title check
Explanation
The title names the fix and its scope: PR description file links resolving in the PR's repository from a No-project thread. The raw summary and PR objectives both describe repository-preferred resolution for ambiguous file links in ChatMarkdown, so the title matches the main change. It follows the conventional commit form the template asks for.
Full details: Out of Scope Changes check
Explanation
The visible change summary lists only apps/web/src/components/ChatMarkdown.tsx (+17/-1) and apps/web/src/components/ChatMarkdown.browser.test.tsx (+33/-0). The source change resolves file links in the markdown file-open path. The test covers a workspace-file-open case with a worktree path. Both relate to the file-link behavior in #41065, so no unrelated change is visible. The full file list could not be confirmed, because the repository diff is unavailable, and the PR description mentions a pickProjectLinkMatch change that does not appear in the summary.
Full details: Description check
Explanation
The description covers the problem, the change, scope, and verification in detail. The Problem section explains the broken tab from a No project thread, and the Change section explains that links rendered outside the thread's folder now resolve to an absolute path under that folder. Scope links the issue (fixes #41065) and states it is a bug fix. Verification gives focused test commands with results, a manual run, before/after evidence, and PR CI results. The template's required sections are all present and filled in, so the check passes. The description does not explicitly say that the fix prefers the PR's repository, which the PR objectives describe, but this gap is minor and does not block the check.
Full details: Linked Issues check
Explanation
Directly linked issue #41065 asks that a repo-relative file link in a linked PR description, opened from a 'No project' scratch thread, resolve against the PR's repository (Option A: registered project matching the PR's owner/name, or Option B: the PR's Files/Code view). The current change summary describes ChatMarkdown.tsx changes to openFileInPanel. It resolves the panel root from the thread worktree path or the matching project's workspace root, and resolves the path relative to cwd when the two differ. The summary does not show how the matching project is chosen. It does not mention a PR-repository preference in pickProjectLinkMatch (packages/client-runtime/src/workspaceBasenameLookup.ts), which the PR description and objectives cite as the fix. The repository diff could not be read because changed blobs are missing from the checkout. The previous PASS rested on a different change summary (a sourceControlMediaRepository fallback) and does not carry over to the current head. Whether the current code resolves the issue's failing case (second project with a different file at the same suffix) is not established. The Evidence section of the PR is also unfilled, which is not a coding requirement.
Resolution
Provide readable diff hunks for apps/web/src/components/ChatMarkdown.tsx and packages/client-runtime/src/workspaceBasenameLookup.ts (or confirm whether the latter changed) at head c3bf1c5 against merge base c89ca0a. Confirm that the matching-project selection in openFileInPanel or pickProjectLinkMatch prefers the project whose repository identity equals the PR repository, and that the fixture case from #41065 resolves to the PR repository's file.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
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; 5 remain after this review.
A pull request body renders with the PR checkout as its cwd, but its
file links handed the panel a path relative to that checkout, which the
panel reads from the thread's own folder. From a No-project thread that
opened a missing file in the scratch folder. Links rendered in another
folder now open the absolute path under it. The earlier repository
retry is removed: it never ran in that case.
Fixes#41065
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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:trustedAuthor is trusted by repo permissions or the VOUCHED list.
1 participant
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.
Clicking a repo-relative file path in a linked pull request's description from a 'No project' thread opened a broken tab that looked for the file in the thread's scratch folder. The description renders in the PR's own checkout, but its file links gave the file panel a path relative to that checkout, and the panel reads relative paths from the thread's folder. Links in markdown rendered in a folder other than the thread's own now open the absolute path under that folder. Ordinary chat links are unchanged.
Fixes #41065
Reproduction on main
Commit 324ac49 (origin/main), web dev server with T3CODE_DEV_SEED=0 and a --home-dir outside any git checkout. Without that, the No project option is hidden because scratch is disabled when the data dir is inside a repo. Fixtures: a git repo
repo-a(origin https://github.com/pingdotgg/t3code.git) holding packages/client-runtime/src/state/filesystem.ts, and a folderhomeholding dev/repo-a plus a second copy at backup/repo-a/packages/client-runtime/src/state/filesystem.ts. Both were added witht3 project add(repo-a, then home). Created a No-project thread with the free Replay provider (cwd /scratch/2026-11-22-go-93b2964d). Linked #28243 through the command palette's 'Link pull request to thread'; its description has inline codepackages/client-runtime/src/state/filesystem.ts, rendered as afilesystem.tsfile chip. Clicking the chip in the PR Summary tab opened a file tab with breadcrumb 'No project > packages > client-runtime > src > state > filesystem.ts' and 'The file could not be accessed or read. It may be missing or inaccessible. Attempted path /scratch/2026-11-22-go-93b2964d/packages/client-runtime/src/state/filesystem.ts. Workspace folder: /scratch/2026-11-22-go-93b2964d.' This matches the report. Control: with the backup copy moved out ofhome, a reload and the same click opened /home/dev/repo-a/packages/client-runtime/src/state/filesystem.ts correctly. Restoring the copy brought the failure back on a fresh load, so it fails every time whenever a second project lists a different file with the same repo-relative suffix.Evidence
Web client, Chromium 156 on Linux, 1280×800, light theme. Both commits used fresh isolated state, native No-project scratch outside Git, and the free Replay provider.
Steps: register repo-a with the target file and the PR repository's origin; register Home with a different backup file at the same repo-relative suffix; start a No-project thread; link #28243; open Summary and click filesystem.ts.
scenarios:prove exited 0: failsOnBase=true, passesOnHead=true. Captures and recordings visually inspected.
Scenario · Runner configuration patch: keep T3 home outside Git
Tests
vp test run apps/web/src/components/ChatMarkdown.browser.test.tsx -t "another checkout"with the baseChatMarkdown.tsx: fails as expected (receivedpackages/state/filesystem.ts)vp test run apps/web/src/components/ChatMarkdown.browser.test.tsx -t "workspace file opens": 6 passedvp test run apps/web/src/components/ChatMarkdown.browser.test.tsx apps/web/src/components/ChatMarkdown.permissions.browser.test.tsx: 2 files, 63 tests passedvp run check:changed: pass (format, lint, knip, typecheck of 2 packages, tests, react compiler)filesystem.tschip in the PR Summary now opens repo-a's file instead of the missing scratch pathNot in this change
ChatMarkdown's other panel opens (skill links and media 'open file') still pass paths unchanged and were not checked for markdown rendered outside the thread's folder.Who did the work
Run by the t3code factory in T3 Code.