mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-10 07:18:10 -05:00
opendevin/core/main.py: Graceful shutdown (#1731)
* opendevin/core/main.py: Graceful shutdown * Shutdown controller at exit * Update opendevin/core/main.py --------- Co-authored-by: Yufan Song <33971064+yufansong@users.noreply.github.com> Co-authored-by: Graham Neubig <neubig@gmail.com>
This commit is contained in:
@@ -17,8 +17,7 @@ workspace_base = os.getenv('WORKSPACE_BASE')
|
||||
)
|
||||
def test_write_simple_script():
|
||||
task = "Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point."
|
||||
controller = asyncio.run(main(task))
|
||||
asyncio.run(controller.close())
|
||||
asyncio.run(main(task))
|
||||
|
||||
# Verify the script file exists
|
||||
script_path = os.path.join(workspace_base, 'hello.sh')
|
||||
@@ -58,8 +57,7 @@ def test_edits():
|
||||
|
||||
# Execute the task
|
||||
task = 'Fix typos in bad.txt. Do not ask me for confirmation at any point.'
|
||||
controller = asyncio.run(main(task))
|
||||
asyncio.run(controller.close())
|
||||
asyncio.run(main(task))
|
||||
|
||||
# Verify bad.txt has been fixed
|
||||
text = """This is a stupid typo.
|
||||
|
||||
Reference in New Issue
Block a user