Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

AutoGPT: Fix file ops (vol. 2)

Reinier van der Leer27e362c6ea51
diff --git a/autogpts/autogpt/autogpt/commands/file_operations.py b/autogpts/autogpt/autogpt/commands/file_operations.py
index f82aaa85cc..8e3b54ab22 100644
--- a/autogpts/autogpt/autogpt/commands/file_operations.py
+++ b/autogpts/autogpt/autogpt/commands/file_operations.py
@@ -242,11 +242,11 @@ def append_to_file(
"""
directory = os.path.dirname(filename)
os.makedirs(directory, exist_ok=True)
- with agent.workspace.open_file(filename, "a") as f:
+ with open(filename, "a") as f:
f.write(text)
if should_log:
- with agent.workspace.open_file(filename, "r") as f:
+ with open(filename, "r") as f:
checksum = text_checksum(f.read())
log_operation("append", filename, agent, checksum=checksum)