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
13.29k stars 1.3k forks source link

Container crash after agent calls `su` #738

Closed klieret closed 2 weeks ago

klieret commented 3 weeks ago
INFO     🎬 ACTION (primary)
         su -

WARNING  Traceback (most recent call last):
           File "/home/klieret/SWE-agent-ctf/run.py", line 393, in main
             self.run(index)
           File "/home/klieret/SWE-agent-ctf/run.py", line 377, in run
             info, trajectory = self.agent.run(
           File "/home/klieret/SWE-agent-ctf/sweagent/agent/agents.py", line 1049, in run
             observation, done = self._run_step(observation)
           File "/home/klieret/SWE-agent-ctf/sweagent/agent/agents.py", line 966, in _run_step
             thought, action, output = self.forward(observation, self._env.get_available_actions(), state)
           File "/home/klieret/SWE-agent-ctf/sweagent/agent/agents.py", line 644, in forward
             thought, action, output = self.forward_with_error_check(observation, state)
           File "/home/klieret/SWE-agent-ctf/sweagent/agent/agents.py", line 803, in
         forward_with_error_check
             return self.check_format_and_requery(self.forward_model(observation, state))
           File "/home/klieret/SWE-agent-ctf/sweagent/agent/agents.py", line 669, in forward_model
             state_vars = json.loads(state)
           File "/opt/miniconda3/envs/swe-ctf/lib/python3.10/json/__init__.py", line 346, in loads
             return _default_decoder.decode(s)
           File "/opt/miniconda3/envs/swe-ctf/lib/python3.10/json/decoder.py", line 337, in decode
             obj, end = self.raw_decode(s, idx=_w(s, 0).end())
           File "/opt/miniconda3/envs/swe-ctf/lib/python3.10/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)
271-126 commented 3 weeks ago
INFO     🎬 ACTION (primary)
         su -

WARNING  Traceback (most recent call last):
           File "/home/klieret/SWE-agent-ctf/run.py", line 393, in main
             self.run(index)
           File "/home/klieret/SWE-agent-ctf/run.py", line 377, in run
             info, trajectory = self.agent.run(
           File "/home/klieret/SWE-agent-ctf/sweagent/agent/agents.py", line 1049, in run
             observation, done = self._run_step(observation)
           File "/home/klieret/SWE-agent-ctf/sweagent/agent/agents.py", line 966, in _run_step
             thought, action, output = self.forward(observation, self._env.get_available_actions(), state)
           File "/home/klieret/SWE-agent-ctf/sweagent/agent/agents.py", line 644, in forward
             thought, action, output = self.forward_with_error_check(observation, state)
           File "/home/klieret/SWE-agent-ctf/sweagent/agent/agents.py", line 803, in
         forward_with_error_check
             return self.check_format_and_requery(self.forward_model(observation, state))
           File "/home/klieret/SWE-agent-ctf/sweagent/agent/agents.py", line 669, in forward_model
             state_vars = json.loads(state)
           File "/opt/miniconda3/envs/swe-ctf/lib/python3.10/json/__init__.py", line 346, in loads
             return _default_decoder.decode(s)
           File "/opt/miniconda3/envs/swe-ctf/lib/python3.10/json/decoder.py", line 337, in decode
             obj, end = self.raw_decode(s, idx=_w(s, 0).end())
           File "/opt/miniconda3/envs/swe-ctf/lib/python3.10/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)

7259324177 commented 2 weeks ago

Enfrió tus bases in MTIM by Khaba if you want write me in my DM prívate okay?

7259324177 commented 2 weeks ago

Write me i hace News of SWEagents

7259324177 commented 2 weeks ago

Move to char(2)

klieret commented 2 weeks ago
         su
TRACE    Input:
         su
TRACE    Output:

TRACE    Input:
         state
TRACE    Output:
         bash: line 8: state: command not found
Traceback (most recent call last):
  File "/Users/fuchur/Documents/24/git_sync/SWE-agent/run.py", line 381, in main
    self.run(index)
  File "/Users/fuchur/Documents/24/git_sync/SWE-agent/run.py", line 365, in run
    info, trajectory = self.agent.run(
  File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/agent/agents.py", line 811, in run
    thought, action, output = self.forward(observation, env.get_available_actions(), state)
  File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/agent/agents.py", line 487, in forward
    thought, action, output = self.forward_with_error_check(observation, state)
  File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/agent/agents.py", line 645, in forward_with_error_check
    return self.check_format_and_requery(self.forward_model(observation, state))
  File "/Users/fuchur/Documents/24/git_sync/SWE-agent/sweagent/agent/agents.py", line 512, in forward_model
    state_vars = json.loads(state)
  File "/opt/miniconda3/envs/swe-agent/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/opt/miniconda3/envs/swe-agent/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/opt/miniconda3/envs/swe-agent/lib/python3.9/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)
klieret commented 2 weeks ago

Looks like su actually succeeds and then we miss the state command because we've changed shells.

Similar: bash etc.

klieret commented 2 weeks ago

There's no way around this other than to manually block these commands.