Skip to content

Commit 323a48a

Browse files
Zhe YuDavidyz
authored andcommitted
fix(nvim): Fix file reference issue in the query tool
1 parent e8170f8 commit 323a48a

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

lua/vectorcode/integrations/codecompanion/query_tool.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,13 @@ Set this to `false` only if you've been instructed by the user to not enable sum
413413
:totable()),
414414
string.format("**VectorCode Tool**: Retrieved %d %s(s)", stdout.count, mode)
415415
)
416-
for _, file in pairs(stdout) do
417-
if not opts.chunk_mode then
416+
if not opts.chunk_mode then
417+
for _, result in pairs(stdout.raw_results) do
418418
-- skip referencing because there will be multiple chunks with the same path (id).
419-
-- TODO: figure out a way to deduplicate.
420419
agent.chat.references:add({
421420
source = cc_common.tool_result_source,
422-
id = file.path,
423-
path = file.path,
421+
id = result.path,
422+
path = result.path,
424423
opts = { visible = false },
425424
})
426425
end

0 commit comments

Comments
 (0)