Symptom
The first agent.run() finishes, then agent.add_new_task() and a second agent.run() raise 'bubus.service.QueueShutDown'.
Evidence what you'll see
- The traceback in the report ends at
bubus/service.pyinput_nowait, raisingQueueShutDown, fromeventbus.dispatch(CreateAgentSessionEvent.from_agent(self)). - The report's agent uses
BrowserProfile(keep_alive=True)and oneBrowserSessionfor both tasks. - Comments on 20 Aug 2025 and 21 Aug 2025 still see the same exception on
0.6.0.
Why it happens
Pull request #2649 says the first agent.run() dispatches CreateAgentSessionEvent, and when that run ends the event bus shuts down. add_new_task() changes the task text and does not start the bus again, so the next run() puts an event on a closed queue. The pull request adds session_initialized: bool = False on AgentState and dispatches CreateAgentSessionEvent only when that flag is false, then sets the flag. CreateAgentTaskEvent is still dispatched on every run, because the task can change.
Affected versions
Reported on browser-use 0.5.9, macOS, with the traceback under Python 3.13. A comment also sees it on 0.5.11. The library log line in the report is Browser-Use Library Version 0.5.9 (pip).
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
- Run one task, call
add_new_task(), run again, and confirm the second run does not raisebubus.service.QueueShutDown.
If it still fails
- Two comments say
0.6.0still raisesQueueShutDown. One of them quotesawait self.eventbus.stop(timeout=10.0)andawait self.close()at the end ofrun(), and says the bus should not stop insiderun(). - On 8 Sep 2025 a maintainer wrote that the newest version fixed it, and linked https://github.com/browser-use/browser-use/blob/main/examples/features/follow_up_task.py. The linked issue does not name that version.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it