-
Hi! Tried to follow the setup instructions for CodeCompanion plugin, but I get the error when an agent tries to use Here's a part of codecompanion debug output where I asked a model just to run local settings = {
model = "claude-3-7-sonnet",
extended_output = false,
extended_thinking = true,
thinking_budget = 16000,
max_tokens = 17000,
temperature = 0,
top_p = nil,
top_k = nil,
stop_sequences = nil,
}
local messages =
{ {
content = "<system prompt>",
cycle = 1,
id = 126646444,
opts = {
tag = "from_config",
visible = false
},
role = "system"
}, {
content = "Try to run vectorcode_files_ls command",
cycle = 1,
id = 29660827,
opts = {
visible = true
},
role = "user"
}, {
content = "I'll run the `vectorcode_files_ls` command to list files in the current project:",
cycle = 1,
id = 368175756,
opts = {
visible = true
},
reasoning = {
content = "The user is asking me to run the `vectorcode_files_ls` command. This command retrieves a list of files that have been added to the database for a given project. Looking at the function definition, I can see it has one parameter:\n\n- `project_root`: The project for which the indexed files will be listed. This parameter is optional, and if left empty, it will default to the current project.\n\nSince the user didn't specify a particular project, I'll run the command for the current project by leaving the `project_root` parameter empty."
},
role = "llm"
}, {
cycle = 1,
id = 137869998,
opts = {
visible = false
},
role = "llm",
tool_calls = { {
_index = 2,
["function"] = {
arguments = "",
name = "vectorcode_files_ls"
},
id = "toolu_01Upx2WKkvFBgTZ542ogY4Tn",
type = "function"
} }
}, {
content = {
content = 'You made an error in calling the vectorcode_files_ls tool: "...on.nvim/lua/codecompanion/strategies/chat/tools/init.lua:168: Expected value but found T_END at character 1"',
is_error = false,
tool_use_id = "toolu_01Upx2WKkvFBgTZ542ogY4Tn",
type = "tool_result"
},
cycle = 1,
id = 631857839,
opts = {
visible = true
},
role = "tool"
}, {
content = {
content = "<path>nvim/init.lua</path>",
is_error = false,
tool_use_id = "toolu_01Upx2WKkvFBgTZ542ogY4Tn",
type = "tool_result"
},
cycle = 1,
id = 1872022500,
opts = {
visible = true
},
role = "tool"
}, {
--- ... rest of files the vectorcode seemed to return Which results in this error messages:
My suspicion is that it's something to do with how vectorcode executable is installed with Might be some issue with codecompanion itself. I use |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
Have you run into similar errors with other tools? I think the As for the |
Beta Was this translation helpful? Give feedback.
-
I'm also having the same issue:
|
Beta Was this translation helpful? Give feedback.
-
@Davidyz I tried your PR, now it throws another error
Here's a part of debug buffer }, {
cycle = 1,
id = 867854911,
opts = {
visible = false
},
reasoning = {
content = "The user is asking me to use the vectorcode_ls tool. Looking at the function definition, this tool \"Retrieve a list of projects accessible via the VectorCode tools\" and doesn't require any parameters. I should call this tool to see what projects are available."
},
role = "llm",
tool_calls = { {
_index = 1,
["function"] = {
arguments = "",
name = "vectorcode_ls"
},
id = "toolu_017XqWpB5DZXEbD1Ha2yoQuC",
type = "function"
} }
}, { So my guess is that the Anthropic API expects something different (maybe just |
Beta Was this translation helpful? Give feedback.
-
@Davidyz seems to be working, thanks! I tried all tools and got OK results I think the PR is ready for review then. Again, big thanks! |
Beta Was this translation helpful? Give feedback.
Hi, since I don't have anthropic API access, would you be able to help test this PR?