entropy-research / Devon

Devon: An open-source pair programmer
GNU Affero General Public License v3.0
3.28k stars 264 forks source link

Error while trying to read files #96

Closed tracy-codes closed 3 months ago

tracy-codes commented 4 months ago

After upgrading to the latest release of Devon, when it attempts to read a file that does exist in the current working directory, it looks like it is unable to actually read the file or there's some hiccup in the subprocess system. It seems like it can open the first file, but then when it attempts to open the second file, that's where it struggles

In this example, I have a rust monorepo where the directory structure it's attempting to access is like <root_workspace_dir>/<crate>/tests/stress_test.rs which it can read. When it attempts to read the second file, located at a path like <root_worksapce_dir>/<crate>/src/net.rs it can't read the file.

System specs:

Example log:

EVENT ID: 27, STATUS: running
event {'type': 'ModelResponse', 'content': '{"thought": "\\nI\'ve opened the `stress_test.rs` file. Now, I need to open and examine the `net.rs` file to understand the structure of the `redacted_test` test. After that, I\'ll be able to compare the two and start refactoring the stress test.\\n", "action": "\\nopen_file redacted/src/net.rs\\n", "output": "<THOUGHT>\\nI\'ve opened the `stress_test.rs` file. Now, I need to open and examine the `net.rs` file to understand the structure of the `redacted_test` test. After that, I\'ll be able to compare the two and start refactoring the stress test.\\n</THOUGHT>\\n\\n<COMMAND>\\nopen_file redacted/src/net.rs\\n</COMMAND>"}', 'producer': 'ConversationalDevon', 'consumer': 'open_file'}
EVENT ID: 28, STATUS: running
event {'type': 'ToolRequest', 'content': {'toolname': 'open_file', 'args': ['redacted/src/net.rs'], 'raw_command': '\nopen_file redacted/src/net.rs\n'}, 'producer': 'ConversationalDevon', 'consumer': 'open_file'}
2024-07-29 12:59:25 [devon-agent] error: NoneType: None
2024-07-29 12:59:25 [devon-agent] error: Traceback (most recent call last):
2024-07-29 12:59:25 [devon-agent] error: File "/Users/redacted/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/devon_agent/environments/shell_environment.py", line 126, in execute
    buffer = read_with_timeout(self.process,lambda : self.get_child_pids(self.process.pid), timeout_duration)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/redacted/.local/pipx/venvs/devon-agent/lib/python3.12/site-packages/devon_agent/environments/shell_environment.py", line 69, in read_with_timeout
    raise TimeoutError("Timeout reached while reading from subprocess.")
TimeoutError: Timeout reached while reading from subprocess.