Skip to content

Commit 8c5493e

Browse files
committed
exit the user enters 'exit' and exit gracefully if the user pressed CMD+d (tested on mac)
CMD+c will still raise: "Exception: Browser.close: Connection closed while reading from the driver"
1 parent 2468b55 commit 8c5493e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ def main():
7373
items = []
7474

7575
while True:
76-
user_input = args.input or input("> ")
76+
try:
77+
user_input = args.input or input("> ")
78+
if user_input == 'exit':
79+
break
80+
except EOFError as e:
81+
print(f"An error occurred: {e}")
82+
break
7783
items.append({"role": "user", "content": user_input})
7884
output_items = agent.run_full_turn(
7985
items,

0 commit comments

Comments
 (0)