Skip to content

Commit 49d1986

Browse files
committed
feat: configurable default agents (#85, #148)
1 parent 4cea5ae commit 49d1986

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lua/gp/config.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ local config = {
8787
-- directory for persisting state dynamically changed by user (like model or persona)
8888
state_dir = vim.fn.stdpath("data"):gsub("/$", "") .. "/gp/persisted",
8989

90+
-- default agent names set during startup, if nil last used agent is used
91+
default_command_agent = nil,
92+
default_chat_agent = nil,
93+
9094
-- default command agents (model + persona)
9195
-- name, model and system_prompt are mandatory fields
9296
-- to use agent for chat set chat = true, for command set command = true

lua/gp/init.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ M.setup = function(opts)
169169

170170
M.refresh_state()
171171

172+
if M.config.default_command_agent then
173+
M.refresh_state({ command_agent = M.config.default_command_agent })
174+
end
175+
176+
if M.config.default_chat_agent then
177+
M.refresh_state({ chat_agent = M.config.default_chat_agent })
178+
end
179+
172180
-- register user commands
173181
for hook, _ in pairs(M.hooks) do
174182
M.helpers.create_user_command(M.config.cmd_prefix .. hook, function(params)

0 commit comments

Comments
 (0)