Files
Nexus/docs/changelog/2026-06-12-browser-p0-p1-fix-deploy.md
T
Nexus Agent e833b923c8 feat(browser): 远程浏览器 Worker 桥接与顶栏固定悬浮窗
接入 Playwright Worker、会话 WebSocket 与全局浏览器面板(固定于 App Bar 下);
含验证码 stealth、设置项默认音与 URL 安全校验;附带 worker 部署与设计文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 06:49:20 +08:00

48 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 2026-06-12 远程浏览器 P0/P1 修复与生产同步
## 摘要
修复 Worker 僵尸 reservation 占槽;前端 `vite build` 同步生产;WS 连接失败时主动 DELETE 会话。
## 动机
Bug 巡查 #1#3:生产无浏览器 SPA(用户连不上);Worker `sessions:1``ready=false` 不进 idle 清理。
## 变更
| 区域 | 内容 |
|------|------|
| `browser-worker/config.py` | `WORKER_RESERVE_TIMEOUT_SEC=120` |
| `browser-worker/session_manager.py` | idle 清理未 attach 的 reservation |
| `browser-worker/main.py` | `attach_stream` RuntimeError 时 `destroy_session` |
| `frontend/.../useRemoteBrowserSession.ts` | WS/未登录失败时 `DELETE /browser/sessions/{id}` |
| 生产 `web/app` | `index-BimRgA6s.js` + BrowserPage 等已 `sync_webapp_to_container.sh` |
| Worker `66.154.115.131` | `docker compose up -d --build``/health``sessions:0` |
## 迁移 / 重启
- 无 DB 迁移
- Worker 已重建;主站仅同步 `web/app`(未重建 API 镜像)
## 验证
```bash
pytest tests/test_browser_url_safe.py tests/test_browser_ui_state.py -q
cd frontend && npm run type-check && npx vite build
curl https://api.synaglobal.vip/app/ # index-BimRgA6s.js
ssh nexus 'sudo docker exec nexus-prod-nexus-1 grep -rl ws/browser /app/web/app/assets/ | wc -l' # ≥1
curl http://66.154.115.131:8443/health # sessions:0
```
浏览器终验:登录 → 左下角地球 → `https://example.com` 有 canvas 画面。
## 未在本批修复
- F1 页内导航 SSRF`framenavigated`
- F3 Worker ufw 公网 8443
- P2 前进/后退 stack 与 Chromium 历史不同步
## 回滚
恢复上一版 `web/app` tarWorker `git checkout` + `docker compose up -d --build`(或保留 idle 修复)。