Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
preserve error exit code
Laith Weinbergera31809b83d22
diff --git a/browser_use/skill_cli/daemon.py b/browser_use/skill_cli/daemon.pyindex ebcd5678c..27b521410 100644--- a/browser_use/skill_cli/daemon.py+++ b/browser_use/skill_cli/daemon.py@@ -13,7 +13,6 @@ import jsonimport loggingimport osimport signal-import sysfrom pathlib import Pathfrom typing import TYPE_CHECKING@@ -347,17 +346,19 @@ def main() -> None:session=args.session,)+ exit_code = 0try:asyncio.run(daemon.run())except KeyboardInterrupt:logger.info('Interrupted')except Exception as e:logger.exception(f'Daemon error: {e}')- sys.exit(1)+ exit_code = 1finally:- # Force-exit to prevent daemon from becoming an orphan+ # asyncio.run() may hang trying to cancel lingering tasks+ # Force-exit to prevent the daemon from becoming an orphanlogger.info('Daemon process exiting')- os._exit(0)+ os._exit(exit_code)if __name__ == '__main__':