princeton-nlp / SWE-agent

SWE-agent takes a GitHub issue and tries to automatically fix it, using GPT-4, or your LM of choice. It solves 12.47% of bugs in the SWE-bench evaluation set and takes just 1 minute to run.
https://princeton-nlp.github.io/SWE-agent/
MIT License
11.86k stars 1.18k forks source link

`ValueError: Could not find process done marker in last line` for some invalid commands #595

Closed klieret closed 1 week ago

klieret commented 1 week ago

Start swe-agent with --model human and enter cd asdf asdf a few times (on OSX)

> cd sdf sdf
INFO     💭 THOUGHT (primary)

INFO     🎬 ACTION (primary)
         cd sdf sdf
ERROR    Read with timeout failed on input:
         ---
         cd sdf sdf
         ---
ERROR    Unknown exception
         Traceback (most recent call last):
           File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/environment/swe_env.py", line 451, in step
             observation = self.communicate(input=action, timeout_duration=25)
           File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/environment/swe_env.py", line 729, in communicate
             output = self._communicate(
           File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/environment/swe_env.py", line 677, in _communicate
             return self._communicate_experimental(input, timeout_duration)
           File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/environment/swe_env.py", line 659, in _communicate_experimental
             buffer, exit_code = read_with_timeout_experimental(self.container, timeout_duration)
           File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/environment/utils.py", line 245, in read_with_timeout_experimental
             raise ValueError(msg)
         ValueError: Could not find process done marker in last line: last_line='/bin/bash: line 233: cd: too many arguments', body='/bin/bash: line 233: cd: too many arguments'
INFO     🤖 MODEL INPUT

         EXECUTION FAILED OR COMMAND MALFORMED
         (Open file: n/a)
         (Current directory: /__Users__fuchur__Documents__24__git_sync__swe-agent-test-repo)
         bash-$
klieret commented 1 week ago

Reason: Lines might be out of order:

> cd test test test
INFO     💭 THOUGHT (primary)

INFO     🎬 ACTION (primary)
         cd test test test
DEBUG    ///PROCESS-DONE:0:PROCESS-DONE///

DEBUG    ///PROCESS-DONE:1:PROCESS-DONE///
         /bin/bash: line 209: cd: too many arguments

ERROR    Read with timeout failed on input:
         ---
         cd test test test
         ---
ERROR    Unknown exception
         Traceback (most recent call last):
           File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/environment/swe_env.py", line 451, in step
             observation = self.communicate(input=action, timeout_duration=25)
           File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/environment/swe_env.py", line 729, in communicate
             output = self._communicate(
           File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/environment/swe_env.py", line 677, in _communicate
             return self._communicate_experimental(input, timeout_duration)
           File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/environment/swe_env.py", line 659, in _communicate_experimental
             buffer, exit_code = read_with_timeout_experimental(self.container, timeout_duration)
           File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/environment/utils.py", line 246, in read_with_timeout_experimental
             raise ValueError(msg)
         ValueError: Could not find process done marker in last line: last_line='/bin/bash: line 209: cd: too many arguments', body='/bin/bash: line 209: cd: too many arguments'
DEBUG    ///PROCESS-DONE:0:PROCESS-DONE///

DEBUG    {"open_file": "n/a", "working_dir": "/__Users__fuchur__Documents__24__git_sync__swe-agent-test-repo"}
         ///PROCESS-DONE:0:PROCESS-DONE///