diff --git a/ee/tabby-ui/app/files/components/chat-side-bar.tsx b/ee/tabby-ui/app/files/components/chat-side-bar.tsx index 30e69de57fb..02c00c87352 100644 --- a/ee/tabby-ui/app/files/components/chat-side-bar.tsx +++ b/ee/tabby-ui/app/files/components/chat-side-bar.tsx @@ -111,7 +111,9 @@ async function buildContextPrompt( return [] } - const repo = (path = path.split('/')[0]) + const segments = path.split('/'); + const repo = segments[0]; + path = segments.slice(1).join('/'); const tokens = code.split(/[^\w]/).filter(x => x)