What's going on?
To reproduce this bug:
- Have an AI open a headed browser using the Playwright CLI, or run
playwright-cli open --headed.
- Navigate to a page where a dialog is triggered and accept/dismiss it manually.
- Ask the AI to get a snapshot of the open page, or run
playwright-cli snapshot. The output will indicate that there is an active dialog (which there shouldn't be). An AI or the user is forced to accept/dismiss the phantom dialog before retrieving a snapshot.
### Error
Error: Tool "browser_snapshot" does not handle the modal state.
### Page
- Page URL: ...
- Console: # errors, # warnings
### Modal state
- ["alert" dialog with message "..."]: can be handled by dialog-accept or dialog-dismiss
While this is not a critical bug, this leads to more consumed AI tokens, especially if multiple dialogs were triggered beforehand, as each must be dismissed one-by-one.
Version
CLI version 1.1.14-17
What's going on?
To reproduce this bug:
playwright-cli open --headed.playwright-cli snapshot. The output will indicate that there is an active dialog (which there shouldn't be). An AI or the user is forced to accept/dismiss the phantom dialog before retrieving a snapshot.While this is not a critical bug, this leads to more consumed AI tokens, especially if multiple dialogs were triggered beforehand, as each must be dismissed one-by-one.
Version
CLI version 1.1.14-17