diff --git a/lua/gp/config.lua b/lua/gp/config.lua index 23a4565..00a5214 100644 --- a/lua/gp/config.lua +++ b/lua/gp/config.lua @@ -87,6 +87,10 @@ local config = { -- directory for persisting state dynamically changed by user (like model or persona) state_dir = vim.fn.stdpath("data"):gsub("/$", "") .. "/gp/persisted", + -- default agent names set during startup, if nil last used agent is used + default_command_agent = nil, + default_chat_agent = nil, + -- default command agents (model + persona) -- name, model and system_prompt are mandatory fields -- to use agent for chat set chat = true, for command set command = true diff --git a/lua/gp/init.lua b/lua/gp/init.lua index d341b34..4034e8e 100644 --- a/lua/gp/init.lua +++ b/lua/gp/init.lua @@ -169,6 +169,14 @@ M.setup = function(opts) M.refresh_state() + if M.config.default_command_agent then + M.refresh_state({ command_agent = M.config.default_command_agent }) + end + + if M.config.default_chat_agent then + M.refresh_state({ chat_agent = M.config.default_chat_agent }) + end + -- register user commands for hook, _ in pairs(M.hooks) do M.helpers.create_user_command(M.config.cmd_prefix .. hook, function(params)