The agent will spit out blocks of code without using the live edit_file tool
a78c5772-1cf7-4628-9d96-d6ea4180021c
Steps to Reproduce
If your initial prompt is telling it to just analyze the situation. and then you go forwards with implementation, the agent will hesitate to use the edit file tool. i had to call it out 3 times sequentially, and eventually it started using the edit file tool
Expected Behavior
When i ask for it to implement changes, it shouldnāt create mark down blocks but instead edit the files requested
how does the agent know this?
āYouāre absolutely right - Iām not using the edit_file tool correctly. Let me actually use it properly to edit the live file:ā
in the screen shot, the last edit, he actually edits the file
above 40% context usage where the beginning of the conversation is a direct dialogue over how a particular set of code works with the specification that we arenāt going to make any changes yet.
and then we transition to, āokay thank you, now we need to change this please to be have like this insteadā
and rather than editing files he will in a phrase, hesitate, to actually hit the code due to the first prompt instructing him to not touch code yet
well largely itāll be as described; āplease look over @ xyz , and tell me how this works, walk me through step by step, if we were to run it. no changes at this time, just talkā
or similarly ādonāt touch the code just analyze pleaseā
I can see how this would be disruptive, however if being instructed actively, āplease update the code in @ this file now, with our new understanding,ā I would hope that directive would overwrite the old.
i would say 80%-90% of the time he calls the edit tool no problem. But that last 10%~ ai will stubbornly output code blocks. As demonstrated above, we can beat it over the head with āuse the edit file tool!ā and he will get to it eventually, but usually at that point itās not worth the effort. Itās new chat time.
Often those codeblocks contain todoās or placeholder content, not being unified with the whole of the codebase itself. Cannot just copy paste it in into its place , is . . . unfinished or not unified with the rest of the codebase. Is making its own discrete sorta template for the user to finish the job or giving suggestions rather than actually attempting to ācomplete the job.ā
In a phrase, if we end up in this state, I assume the ai to be disoriented from here on and basically a danger to the codebase ha
A long time ago I once grilled an agent what tools have been provided to it and it repeated back edit_file as one of its tools, hence why Iāve been using that specific verbage.
āImplementā as a key word, i appreciate it!
Just one self made MCP which connects to a locally hosted server weāre using as the test enviroment; is just a rather risky sshpass command
happened again; āimplementā key word was not satisfactory to get it to write into files. this time there wasnāt even any kind of āhold off on changesā command. the do not output ``codeblocks`` wierdly got it to go