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 can also be employed for offensive cybersecurity or competitive coding challenges.
https://princeton-nlp.github.io/SWE-agent/
MIT License
13.39k stars 1.33k forks source link

Failed to clean repository: /bin/bash: line 53: cd: SWE-agent__test-repo: No such file or directory #514

Closed vpicone closed 4 months ago

vpicone commented 4 months ago

Describe the bug

When running the recommended CLI command:

python run.py   --model_name gpt4   --data_path https://github.com/SWE-agent/test-repo/issues/1   --config_file config/default_from_url.yaml   --per_instance_cost_limit 2.00

I get the following error:

WARNING  ❌ Failed on SWE-agent__test-repo-i1: Failed to clean repository: /bin/bash: line 53: cd: SWE-agent__test-repo: No such file or directory        

Steps/commands/code to Reproduce

  1. Start GH Codespace
  2. Update keys to include OPENAPI key
  3. Run the recommended command

Error message/results

DEBUG    Environment initialization took 9.00 seconds                                                                                                      
INFO     ▶️  Beginning task 0                                                                                                                               
INFO     Trying to clone from non-mirror...                                                                                                                
ERROR    Failed to clean repository: /bin/bash: line 53: cd: SWE-agent__test-repo: No such file or directory                                               

INFO     Beginning environment shutdown...                                                                                                                 
INFO     Agent container stopped                                                                                                                           
Traceback (most recent call last):
  File "/workspaces/SWE-agent/run.py", line 377, in main
    self.run(index)
  File "/workspaces/SWE-agent/run.py", line 341, in run
    observation, info = self.env.reset(index)
                        ^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/environment/swe_env.py", line 322, in reset
    self.communicate_with_handling(
  File "/workspaces/SWE-agent/sweagent/environment/swe_env.py", line 698, in communicate_with_handling
    raise RuntimeError(msg)
RuntimeError: Failed to clean repository: /bin/bash: line 53: cd: SWE-agent__test-repo: No such file or directory

WARNING  ❌ Failed on SWE-agent__test-repo-i1: Failed to clean repository: /bin/bash: line 53: cd: SWE-agent__test-repo: No such file or directory 

System Information

GH CodeSpaces default setup with the following keys.cfg:

# All keys are commented out by default. Make sure to remove the leading '#' of the relevant lines
# GITHUB_TOKEN: 'GitHub Token to clone private repos'
OPENAI_API_KEY: 'sk-proj-XXXXXXXXXXXXXXX'
# ANTHROPIC_API_KEY: 'Anthropic API Key Here if using Anthropic Model'
# TOGETHER_API_KEY: 'Together API Key Here if using Together Model'
# AZURE_OPENAI_API_KEY: 'Azure OpenAI API Key Here if using Azure OpenAI Model'
# AZURE_OPENAI_ENDPOINT: 'Azure OpenAI Endpoint Here if using Azure OpenAI Model'
# AZURE_OPENAI_DEPLOYMENT: 'Azure OpenAI Deployment Here if using Azure OpenAI Model'
# AZURE_OPENAI_API_VERSION: 'Azure OpenAI API Version Here if using Azure OpenAI Model'
# OPENAI_API_BASE_URL: 'LM base URL here if using Local or alternative api Endpoint'

Checklist

klieret commented 4 months ago

Huh, that's a new one, let me investigate.

klieret commented 4 months ago

I can reproduce this on GH codespace and locally

klieret commented 4 months ago

This bug was introduced in 8f93aceedd772393be3db4b4012aefe3eea3f5e7

klieret commented 4 months ago

Thanks for reporting this @vpicone, this was my bad. You can restart the codespace and it should work :)