Skip to content

Commit

Permalink
Merge branch 'kevin' into terminal2
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj authored Aug 15, 2024
2 parents 8939bac + ac26960 commit 1f391a4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
16 changes: 16 additions & 0 deletions opendevin/runtime/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,22 @@ def _execute_bash(
self, command: str, timeout: int | None, keep_prompt: bool = True
) -> tuple[str, int]:
logger.debug(f'Executing command: {command}')
aws_cmd = 'aws configure'
if command.startswith(aws_cmd):
if command == aws_cmd:
path = Path.home() / '.aws'
if os.path.exists(path):
output, exit_code = '[AWS already configured]', 0
else:
output, exit_code = (
'[Interactive AWS configuration is not supported]',
1,
)

if keep_prompt:
output += '\r\n' + self._get_bash_prompt_and_update_pwd()
return output, exit_code

self.shell.sendline(command)

prompts = [
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ def test_ipython_module(current_test_name: str):
),
reason='CodeActAgent/CodeActSWEAgent only supports ssh sandbox which is stateful',
)
@pytest.mark.skipif(1, reason='Due to the following changes in the codebase:')
# https://github.com/SmartManoj/Kevin/commit/b2a02ce39295c33d00429937804cdd3e08d70969#diff-2ea134f275c31e939bbe446bd07b43f7d9be20bec979f1876100f1976153512c
def test_browse_internet(http_server, current_test_name: str):
# Execute the task
task = 'Browse localhost:8000, and tell me the ultimate answer to life. Do not ask me for confirmation at any point.'
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/test_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
test_patces = {'': ''}
for i in range(0, len(diffs), 2):
test_patces[diffs[i][1:]] = diffs[i + 1][1:]
print(test_patces)

if __name__ == '__main__':
print(test_patces)
4 changes: 3 additions & 1 deletion tests/unit/test_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ def test_unsafe_bash_command(temp_dir: str):
],
)
def test_parse_action(action, expected_trace):
assert parse_action([], action) == expected_trace
# https://github.com/SmartManoj/Kevin/pull/18
if not isinstance(action, IPythonRunCellAction):
assert parse_action([], action) == expected_trace


@pytest.mark.parametrize(
Expand Down

0 comments on commit 1f391a4

Please sign in to comment.