-
Notifications
You must be signed in to change notification settings - Fork 45k
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
COMMAND = write_to_file fails if file exists #3514
Comments
to bypass the issue I've commented out the following lines from the function
|
I've got a PR open to fix this #3489 |
If this has been merged to master, the issue is still here |
Opened PR #3643 for fixing this issue |
can confirm that I can still reproduce the issue. |
@Boostrix so you're talking about a situation where the operation is in the log, but someone has manually deleted the file? |
well, not sure if that's generally the case, I believe I was seeing this because I was re-running the same agent (ai_settings.yaml) file giving it variations of the same objectives, so it would obviously have some leftover state (in the form files but apparently also log data?) Regarding my comment, the idea was not that someone might actually delete the file, but that it may be there and may need to be updated by an agent (because it was created by another run/instance, not sure if that makes sense). Also, checking for duplicate ops is obviously meaningful, but should probably yield a response that affects the plan/planning process, so that it knows something went haywire. The errors I've been seeing related to this, didn't impress the planner much - it would simply re-loop, not even changing its approach (aka, same command/same params). This is why I elsewhere suggest to hash action [command] + params and use that as the key into a dict to be able to increment a counter - if that is also done for the response, we can at least use some plausible heuristics to tell if the agent is doing something kinda retarded. Likewise, the command registry/list offered to the LLM to pick the next step would probably benefit from being augmented with a success/fail history (number of invocations and percentage of successes/fails of a certain command) - that would enable the LLM to quickly notice that something isn't quite right with the provided command (in conjunction with a corresponding constraint/performance evaluation) - as it would enable the LLM to favor actions that worked "recently" (I believe I described that somewhere using the "MRU" acronym) |
don't know about all that, but this makes me realize that the file operations log is not a reliable source of truth as it's duplicating the state of the filesystem and it's trivial for those to go out of sync... |
right, you don't need to do anything fancy to make these heuristics go haywire - it's sufficient to resume/re-run an agent or refer to the same file several times via the same list of objectives, sooner or later you'll end up crippling the whole workflow that way. The only way to work around this issue is to intervene and tell the agent to use an alternate solution like a CLI editor To literally detect a dupe command execution attempt, the underlying heuristics would need to hash the old contents and new contents to be written. Then again, maybe it's just trying to be too clever here ? I mean, it's called "write_to_file" after all, not "check_if_necessary_to_write_to_file". Dupe detection is necessary due to deeper issues in the agent system - but writing/updating a file always entailed opening/writing and closing it, and at the very least that means changing its timestamp - thus, trying to be too clever by showing an error for a file operation that is perfectly valid - and which has side effects that are not covered by the heuristics (different contents / timestamp changed), is begging for problems like these. For now, I'd probably just disable the check or make it a "soft" error (aka warning), saying that an existing file seems to be overwritten - but the whole log approach to look at file system state that may not even be current is also problematik IMO |
This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days. |
This issue was closed automatically because it has been stale for 10 days with no activity. |
Which Operating System are you using?
Windows
Which version of Auto-GPT are you using?
Stable (branch)
GPT-3 or GPT-4?
GPT-3.5
Steps to reproduce 🕹
Auto-GPT fails to
write_to_file
if file already exists and returnsCommand write_to_file returned: Error: File has already been updated.
and can loop over again and again trying to write to that fileto bypass this behavior, i had to remove the line manually
write: hello.py
from thefile_logger.txt
each loop for Auto-GPT keeps on working on the file.Current behavior 😯
No response
Expected behavior 🤔
No response
Your prompt 📝
# Paste your prompt here
Your Logs 📒
The text was updated successfully, but these errors were encountered: