Replies: 4 comments 1 reply
-
|
The Zed guys dropped me a message about this a couple of weeks ago. It might be marked as unstable but my experience is that they're normally pretty full baked features by the time they let me know about them so happy to accept one of your awesome PRs to add it in. From a usability perspective, this poses an interesting dilemma. Right now when users change model in the chat buffer with commands = {
"npx",
"--silent",
"--yes",
"@zed-industries/claude-code-acp",
}, |
Beta Was this translation helpful? Give feedback.
-
|
I was able to get it working by updating to the latest acp ( keymaps = {
change_model = {
modes = { n = "gm" },
description = "Change Model",
callback = function(chat)
if chat.adapter.type == "acp" then
local models = { "sonnet", "opus", "haiku" }
vim.ui.select(models, { prompt = "Select Model" }, function(selected)
if not selected or not chat.acp_connection then
return
end
local result = chat.acp_connection:send_rpc_request("session/set_model", {
sessionId = chat.acp_connection.session_id,
modelId = selected,
})
if result then
vim.notify("Model changed to " .. selected, vim.log.levels.INFO)
else
vim.notify("Failed to change model (unstable API)", vim.log.levels.WARN)
end
end)
else
require("codecompanion.interactions.chat.keymaps.change_adapter").select_model(chat)
end
end,
},
}, |
Beta Was this translation helpful? Give feedback.
-
|
For gemini-cli you could use: gemini_cli = function()
return require("codecompanion.adapters").extend("gemini_cli", {
commands = {
pro_2_5 = {
"gemini",
"--model=gemini-2.5-pro",
"--experimental-acp",
},
},
... |
Beta Was this translation helpful? Give feedback.
-
|
#2641 will add support for this. It's fully working right now and behaves the same way as changing models for a http adapter. Just need to allow users to select the command via the command line or slash command. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, ACP adapters work a little differently than traditional remote LLM adapters in that if, for example, you're using ACP to connect to claude code you only see a "default" adapter. This is because codecompanion doesn't yet support
SetSessionModel*. Also,/modelis not supported as a slash command in the ACP world (becauseSetSessionModelis in the ACP spec).*In the ACP docs this is considered an unstable API, but alas it is the only way to select a model within a session and is already supported by the claude code ACP.
My thinking is in the same way that we update slash commands after they're broadcasted by the ACP host we can update the available models for the adapter after we receive the model list after session initialization. It does mean that, initially, you'd still only be able to select "default" as the model until a few seconds after you open the chat buffer (this limitation already exists for slash commands though).
Happy to throw up a PR again to add this. Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions