-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[discarded] Add append_file to CodeActAgent, incl. tests; some markdown fixes #2207
Conversation
(this is not a review) Thank you! I think this could potentially be helpful! Given that we are running a few benchmarks on the current CodeActAgent, I propose we don't merge this (or other PRs attempting to tweak CodeActAgent or edit tools) in a week. |
Absolutely fine with me. Good luck with the benching! :D |
A counter-argument: agent skills should only accept skills that are non-trivial to implement. Appending could be easily done via python or bash commands, and we probably shouldn't prompt LLM to use it. |
There are several logistical, technical and economic advantages of an explicit
Above is "trivial" for us, but with the current implementation it is not a cost-effective and seemingly "harder" way for the LLM to achieve results. Major question: Potential PR changes |
Your points are valid and I agree it is hard to LLM to use |
I'll look into it, but we do have the optional linting around it, so not sure if we can cut it down to a simple echo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll try to get the code cleaned up a little more first and let you know when ready. 👍 |
@neubig got my branch updated, make lint'ed, agentskills tests successfull, good for review. Note: I did add append_file to prompt.py but not with specific examples. |
Need to check why integration tests fail, might be merge issue because of outdated mock log files. |
My branch is in a bad state. Will re-issue this PR with fresh branch off of main. |
This PR adds a new method append_file(content: str) to the agent skills.
In testing OD with some file operations, it is a noticable issue for repeated errors by the model (used Gemini Pro 1.5) that adding content to a file often causes exceptions due to an invalid "start" line number for the edit_file command.
It seems very hard for the model to identify or keep track the total number of lines in a file or it is just not good enough in counting (ask an LLM to count the words of its answer and you know what I mean).
This issue can cause extra cost when it shouldn't.
Such an error then looks like this:

An example prompt to demonstrate the use of it could be like:
"Write the numbers 5 to 10 into a new file named test.txt"
A followup prompt could then just say:
"Append the numbers 20 to 25 to the same file."
If it were to use the edit_file command, chances would be high that it would use the wrong line number(s) again.
Also: fixed some more markdown lints in readme's, added several test methods for append_file.
Pre-commit was clean.
I need help with this PR! I am not a Python developer and not a pro-Linux user! /shamebell
How to run these tests - I haven't figured that out yet.
It isn't clear to me, whether I'm to produce some of the log outputs for demonstration
or I missed some place to add the new method name.
Would be great if someone could assist me or provide advice, thanks a lot in advance! :)