-
-
Notifications
You must be signed in to change notification settings - Fork 231
[Bug]: inline strategy model overrides cause issue with v15.9.0 #1521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Important If your issue does NOT contain a valid Thanks @dhruvinsh. I'll get to this as soon as I can. In the meantime, please ensure:
|
I have the same issue with copilot after just installing codecompanion. I also rolled back to 15.8.0 and it fixed the issue |
I'll open this up but I cannot recreate this |
@olimorris I can try your minimal file if you'd like? Just to confirm the above, is it the one they provided? They too are using gemini for the inline (overriding copilot to be pointed at gemini pro) |
The minimal file provided by @dhruvinsh didn't throw an error for me as seen in the screenshot I shared. So either it doesn't contain the error or the instructions on how to cause the error are erroneous. |
So I have just added this: local function prompt_codecompanion_gemini()
local query = vim.fn.input("Query: ")
if query ~= "" then
vim.cmd(string.format("CodeCompanion gemini %s", query))
end
end
vim.keymap.set({ "n", "v" }, "<leader>ai", prompt_codecompanion_gemini, { noremap = true, silent = true }) and it works around the code action failure |
it sucks that @olimorris can't reproduce the issue, I will work on better reproducible method. But for now I am doing some debugging on the side and focusing on copilot models only, all the
once I apply the patch manually, I ran into different issue as below,
After inspecting the response of json, it look like this.
update: |
…is#1521 This commit refactors the handling of model identifiers to consistently support model objects. Previously, models were often treated as simple strings. This change ensures that if a model is represented as an object (e.g., `{ name = "model-id", ... }`), its `name` property is correctly used. Key changes: - In `http.lua`, the request building logic now explicitly extracts `model.name` if `model` is an object, ensuring the correct string identifier is sent in the API request. - Adapters for Copilot and OpenAI have been updated to access `model.name` for internal logic that relies on the model identifier, such as conditional parameter availability or message role transformations. This change improves the robustness and flexibility of model handling within the system, paving the way for more structured model metadata.
Reference: olimorris/codecompanion.nvim#1521 Updated the version of the 'codecompanion.nvim' plugin from '*' to 'v15.8.0' to ensure compatibility and stability.
I also have a problem with
But if I open the chat window prompt_library = {
['Generate a Commit Message'] = {
opts = {
adapter = {
name = 'anthropic',
model 'claude-3-5-sonnet-20241022'
},
},
},
}, |
This should now be closed. Some feedback on this bug report:
This is why I couldn't reproduce this at first. So please be explicit and non-assuming in the future. |
Did you check the docs and existing issues?
Neovim version (nvim -v)
0.11.0
Operating system/version
MacOS 15.5
Adapter and model
Copilot and gemini-2.5-pro
Describe the bug
according to docs, I am overriding the adapter
But when I try to run inline strategy I get below error.
Issue happens with v15.9.0 only, If I roll back to v15.8.0, its fine.
According go source code and docs, string values are allowed:
codecompanion.nvim/lua/codecompanion/adapters/init.lua
Line 330 in 4318576
Steps To Reproduce
Expected Behavior
Inline strategy model override with string name should work.
init.lua file
Log output
No response
Have you provided and tested with a repro.lua file?
The text was updated successfully, but these errors were encountered: