kilocode icon indicating copy to clipboard operation
kilocode copied to clipboard

[VS Code] Clickable file links in agent responses don't work in multi-repo workspaces

Open ehudc opened this issue 4 months ago • 3 comments

Description

Description

Clickable file links rendered in chat (auto-linkified inline-code paths, and relative markdown links) fail to open in a VS Code window whose workspace root is a non-git parent containing multiple repos (root = / or ~/workspace, with child repos like ~/workspace/backend, ~/workspace/frontend). Clicking a relative reference such as spec/foo_spec.rb:12 or a bare foo.rb produces "File not found" or an ambiguous multi-match picker. Only absolute-path links open reliably.

This shares a root cause with the companion bug where the Files-Changed / worktree UI is hidden in multi-repo workspaces: both resolve against the workspace root instead of the session's actual working directory.

Root cause (code links pinned to commit 63a38f5)

Net effect in a multi-repo workspace: relative links join to / (miss), then glob across everything under /, yielding "File not found" or an ambiguous picker. Absolute paths work only because openFile short-circuits isAbsolutePath before this logic.

Suggested fix

Resolve relative file links (and scope the findFallback glob) against the active session's working directory / the repo the referenced file lives in, rather than the workspace root. This is the same underlying fix as the git-detection bug filed in https://github.com/Kilo-Org/kilocode/issues/12832: give sessions a real working-directory concept instead of falling back to a single workspace root. Note a complete fix also needs to account for bare relative filenames being inherently ambiguous across a multi-repo tree.

Plugins

No response

Kilo version

7.4.17

Steps to reproduce

  1. Open VS Code with a non-git parent as the workspace root (root = / or a folder containing multiple git sub-repos).
  2. In a Kilo session, get the assistant to reference a file with a relative path (e.g. inline-code spec/foo_spec.rb:12, or a markdown link [x](spec/foo_spec.rb)) inside one of the child repos.
  3. Click the link. Observe: "File not found" or an ambiguous multi-match picker.
  4. Reference the same file by absolute path → it opens correctly.

Screenshot and/or share link

No response

Operating System

macOS 26.5

Terminal

No response

ehudc avatar Aug 03 '26 21:08 ehudc

Hey @ehudc, I am trying to reproduce the issue and I wasn't able to. Could you check if you still see this issue in the latest release?

johnnyeric avatar Aug 11 '26 13:08 johnnyeric

Updated to 7.4.21, also can't reproduce now. Relative file links and path:line jumps into child repos now open correctly in a multi-repo (non-git-root) workspace.

The fix is upstream of the code I pinned: editor-actions.ts and file-path.ts are unchanged, but getWorkspaceDirectory(session) now resolves to the session's actual repo dir instead of falling back to the workspace root. That landed in #12566 (v7.4.18), after this was filed on 7.4.17.

Closing current issue, will re-open if it re-appears.

ehudc avatar Aug 11 '26 16:08 ehudc

aye i too get that exact behaviour

cryptolit0 avatar Aug 13 '26 16:08 cryptolit0