@@ -262,11 +262,11 @@ function M.complete_items(callback)
262262 }
263263 end
264264
265- for _ , agent in ipairs (agents ) do
265+ for agent , description in pairs (agents ) do
266266 items [# items + 1 ] = {
267267 word = ' @' .. agent ,
268268 kind = ' agent' ,
269- menu = ' Use the specified agent ' ,
269+ menu = description ,
270270 icase = 1 ,
271271 dup = 0 ,
272272 empty = 0 ,
402402--- Select a Copilot GPT model.
403403function M .select_model ()
404404 async .run (function ()
405- local models = state .copilot :list_models ()
405+ local models = vim . tbl_keys ( state .copilot :list_models () )
406406 models = vim .tbl_map (function (model )
407407 if model == M .config .model then
408408 return model .. ' (selected)'
426426--- Select a Copilot agent.
427427function M .select_agent ()
428428 async .run (function ()
429- local agents = state .copilot :list_agents ()
429+ local agents = vim . tbl_keys ( state .copilot :list_agents () )
430430 agents = vim .tbl_map (function (agent )
431431 if agent == M .config .agent then
432432 return agent .. ' (selected)'
@@ -507,7 +507,7 @@ function M.ask(prompt, config, source)
507507 updated_prompt = string.gsub (updated_prompt , ' #buffers?%s*' , ' ' )
508508
509509 async .run (function ()
510- local agents = state .copilot :list_agents ()
510+ local agents = vim . tbl_keys ( state .copilot :list_agents () )
511511 local current_agent = config .agent
512512
513513 for agent in updated_prompt :gmatch (' @([%w_-]+)' ) do
0 commit comments