BrowserNonVisualToolkit
FunctionTool
s.
init
del
- We avoid running during the Python interpreter shutdown phase
(
sys.is_finalizing()
), because the import machinery and/or event loop may already be torn down which leads to noisy exceptions such asImportError: sys.meta_path is None
orRuntimeError: Event loop is closed
. - We protect all imports and event-loop operations with defensive
try/except
blocks. This ensures that, even if cleanup cannot be carried out, we silently ignore the failure instead of polluting stderr on program exit.
_validate_ref
_ensure_agent
web_agent_model
provided.