Files
Nexus/docs/reports/2026-06-13-bug-patrol.md
T
Nexus Agent ba7c790f38 feat(watch): show probe history in Beijing time and retire remote browser
Monitoring history charts and tables now format UTC timestamps as Asia/Shanghai.
Remove Playwright worker, global browser panel, and related API routes; open site URLs in a new tab instead. Fix chain test Redis pipeline mock.
2026-06-13 16:32:02 +08:00

105 lines
4.2 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.
# Bug 巡查 — 2026-06-13
**日期**2026-06-13
**方法**:全量 pytest + L2b + 前端 build/type-check + 代码走读 + 工作区 diff 审查
**生产**https://api.synaglobal.vip(本机外网/SSH 不可达,见 §5)
## 进度条
| 步骤 | 状态 |
|------|------|
| `local_verify.sh` | ✅ 26/26 |
| `pytest tests/` | ✅ 581/581(修 mock 后) |
| `pytest tests/chain` | ✅ 9/9 |
| `vite build` | ✅ |
| `npm run type-check` | ❌ 工作区未提交删除浏览器文件 |
| 生产探针 | ⚠️ 跳过 |
---
## 发现与处理
| # | 严重度 | 问题 | 根因 | 状态 |
|---|--------|------|------|------|
| 1 | **P2** | `CH-AGT-001` 链条测试失败 | `count_monitored_connectivity` 改用 `redis.pipeline().hgetall`,测试仍 mock 顶层 `hgetall` | **已修**`test_agent_dashboard_flow.py` 补 pipeline mock |
| 2 | P1 | 监测历史仍显示 UTC | 北京时间 UI 未提交/未部署 | **未修** — 见 `docs/reports/2026-06-13-watch-session-patrol.md` |
| 3 | P1 | 远程浏览器「半删」工作区 | `browser-*` 已从磁盘删除但未 `git commit`HEAD/生产仍有 `/browser` 路由 | **未提交** — 需整包提交或 `git restore` |
| 4 | P2 | `npm run type-check` 失败 | 浏览器相关 `.vue/.ts` 已删但未入 index`vue-tsc --build` 报 TS6053 | 随 #3 一并 `git add` 删除后恢复 |
| 5 | P3 | 仪表盘 `online=0` 难察觉 Redis 故障 | `server_stats` catch 后静默归零 | 设计取舍(有 warning 日志) |
| 6 | — | SSH 探针全线失败 | `.strip('"')` 破坏 bash | **已修已部署** `adee25d` |
| 7 | — | TTL 到期 ghost pin | API 未同步 `_finalize_due_pins` | **已修** `2026-06-12` |
| 8 | — | `onRemove` 无错误提示 | — | **已修**`WatchSlotRow` 已有 try/catch |
---
## P2 — 链条测试回归(已修)
```
FAILED tests/chain/test_agent_dashboard_flow.py::test_heartbeat_then_stats_online_count
WARNING: Failed to count monitored connectivity: 'coroutine' object has no attribute 'hgetall'
```
引入提交:`7209f53`(仪表盘 `count_monitored_connectivity` + Redis pipeline)。
门控 Gate 3 只跑 `tests/test_api.py`**不跑 chain**;但 Gitea CI 有独立 `pytest tests/chain` job,会持续红。
修复:mock `redis.pipeline()``test_server_connectivity.py` 同模式。
---
## P1 — 监测历史北京时间(用户可见)
工作区已改 `formatChartAxisBeijing` / `formatDateTimeBeijing`,生产 `web/app/` 仍为旧 bundle → **时间列比北京时间少 8 小时**
---
## P1 — 远程浏览器删除未提交
| 层 | HEAD / 生产 | 工作区 |
|----|-------------|--------|
| 路由 `#/browser` | ✅ 有 | ❌ 已删 |
| `GlobalBrowserPanel` | ✅ 有 | ❌ 已删 |
| `/api/browser/*` | ✅ 有 | ❌ 已删 |
| `vite build` | — | ✅ 通过 |
| `type-check` | — | ❌ 失败 |
**风险**:只部署前端 build(工作区)而不部署后端删除 → 404;只提交后端不提交前端 → 导航仍指向已删页面。
**建议**:按 `docs/changelog/2026-06-12-remove-remote-browser.md` **整包提交** 后一次部署。
---
## P3 — 仪表盘统计静默降级
```192:197:server/api/servers.py
except Exception as e:
logger.warning(f"Failed to count monitored connectivity in server_stats: {e}")
fleet = {"monitored": 0, "online": 0, "offline": 0}
main_scope = {"monitored": 0, "online": 0, "offline": 0}
```
Redis 异常时 UI 显示 0 在线而非错误态;运维需查日志。非本次引入,记录备查。
---
## 本地验证命令
```bash
bash scripts/local_verify.sh # 26/26
.venv/bin/pytest tests/ -q # 581 passed
.venv/bin/pytest tests/chain -q # 9 passed
cd frontend && npx vite build # OK
cd frontend && npm run type-check # 浏览器删除提交前 FAIL
```
---
## 待办优先级
| 优先级 | 项 |
|--------|-----|
| P0 | 提交链条测试修复(`test_agent_dashboard_flow.py` |
| P1 | 部署监测历史北京时间(含 audit + changelog |
| P1 | 远程浏览器删除:整包 commit + 部署,或 `git restore` 回滚工作区 |
| P2 | 生产复验:监测插槽数据、北京时间、CI chain job 绿 |