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

Empty trajectories should be overwritten instead of causing JSONDecodeError #614

Closed klieret closed 1 week ago

klieret commented 1 week ago
INFO     ⏭️ Skipping existing trajectory:
         trajectories/klieret/azure-gpt4__swe-bench-dev-40-seed24-full__default__t-0.00__p-0.95__c-4.00__i
         nstall-1/pyvista__pyvista-432.traj
Traceback (most recent call last):
  File "/home/klieret/SWE-agent/run.py", line 382, in main
    self.run(index)
  File "/home/klieret/SWE-agent/run.py", line 340, in run
    if self.should_skip(instance_id):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/klieret/SWE-agent/run.py", line 440, in should_skip
    data = json.load(f)
           ^^^^^^^^^^^^
  File "/opt/miniconda3/envs/bitbop/lib/python3.12/json/__init__.py", line 293, in load
    return loads(fp.read(),
           ^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/bitbop/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/bitbop/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/bitbop/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)