File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ function M.add_selection(selection)
9292end
9393
9494function M .add_file (file )
95+ --- TODO: probably need a way to remove a file once it's been added?
96+ --- maybe a keymap like clear all context?
97+
9598 if not M .context .mentioned_files then
9699 M .context .mentioned_files = {}
97100 end
@@ -318,7 +321,10 @@ function M.format_message(prompt, opts)
318321 local parts = { { type = ' text' , text = prompt } }
319322
320323 for _ , path in ipairs (context .mentioned_files or {}) do
321- table.insert (parts , format_file_part (path , prompt ))
324+ -- don't resend current file if it's also mentioned
325+ if not context .current_file or path ~= context .current_file .path then
326+ table.insert (parts , format_file_part (path , prompt ))
327+ end
322328 end
323329
324330 for _ , agent in ipairs (context .mentioned_subagents or {}) do
You can’t perform that action at this time.
0 commit comments