We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0e2a81 commit cdcb5a0Copy full SHA for cdcb5a0
1 file changed
src/browser/model_management.py
@@ -407,6 +407,10 @@ async def _handle_initial_model_state_and_storage(page: AsyncPage):
407
else:
408
logger.info(' localStorage 状态良好 (isAdvancedOpen=true, promptModel有效),无需刷新页面。')
409
except Exception as e:
410
+ from playwright._impl._errors import TargetClosedError
411
+ if isinstance(e, TargetClosedError):
412
+ logger.debug(f'处理初始模型状态时浏览器已关闭: {e}')
413
+ return
414
logger.error(f'❌ (新) 处理初始模型状态和 localStorage 时发生严重错误: {e}', exc_info=True)
415
try:
416
logger.warning(' 由于发生错误,尝试回退仅从页面显示设置全局模型 ID (不写入localStorage)...')
0 commit comments