Repository navigation
fix(chat): open worktree references from the branch copy - #1780
Merged
Merged
Conversation
An isolated session's files live in its worktree, but chat references can still carry a path from the parent checkout: project instructions, MCP tools, or a reference captured before isolation. The resolver rejected that path as outside its roots, and the renderer then handed the file view a relative path that it resolved against the parent checkout, so the click either failed or opened the main-branch copy. Rebase an absolute parent-checkout reference onto the same relative path in the worktree when that file exists, and keep the worktree's absolute path in the renderer so the file view opens the branch copy. Paths that exist only in the parent still report outside-allowed-roots. fixes vastsa#1747
Current main adds a second search handler in the same workspace IPC module. Keep that handler and the contributor's worktree reference mapping together in the integration candidate.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
修复 #1747。
隔离会话的文件在 worktree 里,但聊天引用可能仍带主 checkout 的路径(项目指令、MCP 工具,或在隔离前生成的引用)。解析器会把它判为根外路径;即使解析成功,渲染层还会把主根命中转成相对路径交给文件视图,插件再按主 checkout 解析,于是点击失败或打开主干版本。
改动
fsResolveRef:绝对引用落在父 checkout 内、且 worktree 有同名文件时,映射到 worktree 的同相对路径;只在父 checkout 存在的文件仍然返回outside-allowed-roots。验证
fixes #1747