[BUG] Built-in browser tool failed after closing popups

Author: Code-MonkeyZhangCreated Sep 18, 2026Updated Sep 18, 2026
Labelsbug

Craft Agents Version

0.13.3

Operating System

macOS (Apple Silicon)

OS Version

macOS 15.6

AI Provider

Anthropic API (direct)

Model

GLM-5.3, z.ai via the Pi provider

Description

When the user asks agent to use the browser, agent will open a browser window for the browser_tool. The user can also browse in that window by hand, like in a normal browser, and clicking some links opens popup windows.

However when the user closes those popups and click Terminate Browser, this built-in browser tool will not be able to use again and Object has been destroyed error will appear. The user has to quit and restart the whole app to recover.

Steps to Reproduce

  • ask agent to use browser tool
  • open browser window then open a popup window, then close popup
  • click terminate browser
  • ask agent to use browser tool again

Expected Behavior

After the user terminates a browser, the next browser_tool call should work normally on a fresh window

Actual Behavior

Object has been destroyed error appear at the terminate step. Can't use browser tool afterwards.

Screenshots / Screen Recordings

https://github.com/user-attachments/assets/d7b594f1-dad1-4801-83e9-96de0c5b5753

Debug Logs

bash
13:55:39 browser_tool -> Object has been destroyed
13:55:47 browser_tool -> Object has been destroyed
13:55:53 browser_tool -> Object has been destroyed
13:56:00 browser_tool -> Object has been destroyed
14:41:36 browser_tool open -> Object has been destroyed
14:56:21 browser_tool -> Object has been destroyed
14:56:26 browser_tool open -> Object has been destroyed
14:56:29 browser_tool -> Object has been destroyed
14:57:09 app restarted, session restored
14:59:25 browser_tool open -> opened in-app browser window
14:59:44 browser_tool navigate -> Google News World section
15:00:23 browser_tool snapshot -> captured
15:01:21 browser_tool -> Object has been destroyed
15:01:26 browser_tool -> Object has been destroyed
15:02:27 browser_tool -> Object has been destroyed
15:02:35 browser_tool open -> Object has been destroyed

Additional Context

  • Possibly related, #695.

Source: craft-ai-agents/craft-agents-oss