修复 Web 预检浏览器失败恢复 #591

Merged
suzmii merged 6 commits from fix/web-preflight-browser-recovery into master 2026-10-03 17:33:22 +08:00
Member

关联 Issue: #584

问题

Web 游戏环境预检在 Edge/Chrome 的 WS 握手或 CDP 连接瞬态失败时直接阻断首次创建;原失败路径只确认 root 收束,Windows Job 子树未确认清空,且没有失败触发的隔离 Profile 恢复。

修改

  • 为浏览器启动失败记录阶段、原因、子进程退出和清理确认;WS/CDP 瞬态失败仅在清理确认后用新临时目录和 Profile 自动重试一次。
  • Windows 清理同时核对可信浏览器镜像、进程启动身份、精确 user-data-dir 命令行和 Job 子树;owner 缺失、写入失败、目录过新、PID 退出/复用或归属不明保持 fail-closed。
  • 预检 blocked 报告和 Tauri 错误保留安全诊断;稳定错误码新增 browser-recovery-failed;首页原有状态区仍只显示稳定分类,原始诊断进入日志。
  • 更新 AGC 主规范、Issue 584 里程碑和实施计划。

验证

  • cargo test 浏览器定向:51 passed
  • cargo test Web 预检定向:9 passed
  • 真实浏览器健康 smoke:1 passed
  • 首页预检 Vitest:6 passed
  • AGC typecheck、Rust fmt、check:encoding、check:doc-index、git diff --check:通过

风险边界

清理未确认时不启动第二个浏览器,不执行全量 taskkill,不触碰用户 Edge、其它 AGC 实例或非 AGC Profile.

关联 Issue: #584 ## 问题 Web 游戏环境预检在 Edge/Chrome 的 WS 握手或 CDP 连接瞬态失败时直接阻断首次创建;原失败路径只确认 root 收束,Windows Job 子树未确认清空,且没有失败触发的隔离 Profile 恢复。 ## 修改 - 为浏览器启动失败记录阶段、原因、子进程退出和清理确认;WS/CDP 瞬态失败仅在清理确认后用新临时目录和 Profile 自动重试一次。 - Windows 清理同时核对可信浏览器镜像、进程启动身份、精确 user-data-dir 命令行和 Job 子树;owner 缺失、写入失败、目录过新、PID 退出/复用或归属不明保持 fail-closed。 - 预检 blocked 报告和 Tauri 错误保留安全诊断;稳定错误码新增 browser-recovery-failed;首页原有状态区仍只显示稳定分类,原始诊断进入日志。 - 更新 AGC 主规范、Issue 584 里程碑和实施计划。 ## 验证 - cargo test 浏览器定向:51 passed - cargo test Web 预检定向:9 passed - 真实浏览器健康 smoke:1 passed - 首页预检 Vitest:6 passed - AGC typecheck、Rust fmt、check:encoding、check:doc-index、git diff --check:通过 ## 风险边界 清理未确认时不启动第二个浏览器,不执行全量 taskkill,不触碰用户 Edge、其它 AGC 实例或非 AGC Profile.
suzmii added 1 commit 2026-10-02 20:57:30 +08:00
修复 Web 预检浏览器失败恢复
Project CI / Backend tests (pull_request) Failing after 34s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m45s
Project CI / Frontend tests (pull_request) Successful in 2m14s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m13s
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 4m23s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m55s
Project CI / Native shell tests (pull_request) Successful in 5m44s
2579c04c4d
- WS 握手与 CDP 连接瞬态失败在确认进程树清理后使用新 Profile 重试一次\n- 加强 Windows Edge 进程身份、命令行 Profile 与 Job 子树归属校验\n- 透传恢复阶段诊断并补充预检规范、里程碑计划和定向测试
suzmii added the Kind/Bug
Priority
High
2
labels 2026-10-02 20:58:15 +08:00
Author
Member

本轮评审发现与修复:P1 Windows Job 绑定竞态:spawn 后绑定 Job 的窗口内子进程可能逃逸,导致 cleanup-confirmed 误判;已绑定 root 后逐 PID 纳入绑定窗口内已有子树,覆盖无法确认时收束已知整树并 fail-closed。P1 含空格 Profile 解析失败:已使用 CommandLineToArgvW,并补充含空格 Profile 回归测试。P1 Job 绑定失败时只回收 root:已固定 root 启动身份并走身份校验的整树回收。P2 清理失败诊断丢失:已保留结构化 shutdown 诊断并加入投影测试。P2 错误码契约缺项:已将 web-preflight-browser-environment-failed 纳入权威技术方案。修复已提交并推送,当前 head 为 c7d70ba89,等待 CI。浏览器 Rust 定向测试 53 passed,Web 预检测试 9 passed;Rust fmt、编码和文档索引检查通过。

本轮评审发现与修复:P1 Windows Job 绑定竞态:spawn 后绑定 Job 的窗口内子进程可能逃逸,导致 cleanup-confirmed 误判;已绑定 root 后逐 PID 纳入绑定窗口内已有子树,覆盖无法确认时收束已知整树并 fail-closed。P1 含空格 Profile 解析失败:已使用 CommandLineToArgvW,并补充含空格 Profile 回归测试。P1 Job 绑定失败时只回收 root:已固定 root 启动身份并走身份校验的整树回收。P2 清理失败诊断丢失:已保留结构化 shutdown 诊断并加入投影测试。P2 错误码契约缺项:已将 web-preflight-browser-environment-failed 纳入权威技术方案。修复已提交并推送,当前 head 为 c7d70ba89,等待 CI。浏览器 Rust 定向测试 53 passed,Web 预检测试 9 passed;Rust fmt、编码和文档索引检查通过。
suzmii added 2 commits 2026-10-03 12:50:52 +08:00
修复 Web 预检浏览器恢复与安全收束
Project CI / Backend tests (pull_request) Failing after 28s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
c833e30d73
修复 Windows Job 绑定窗口内子树未纳入的问题,无法确认时收束并 fail-closed。

使用 CommandLineToArgvW 校验含空格 Profile,补充 Job 子树与 Profile 回归测试。

补齐清理失败安全诊断和浏览器环境错误码契约。
suzmii added 1 commit 2026-10-03 12:52:19 +08:00
Merge remote-tracking branch 'origin/master' into fix/web-preflight-browser-recovery
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m50s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m16s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 4m45s
Project CI / Backend tests (pull_request) Successful in 4m53s
Project CI / Frontend tests (pull_request) Successful in 2m26s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m18s
Project CI / Native shell tests (pull_request) Successful in 5m46s
Project CI / Repository checks (pull_request) Successful in 3m35s
e7530d0c8e
suzmii added 2 commits 2026-10-03 16:41:39 +08:00
固定 Windows 浏览器 root 与子进程启动身份,Job 绑定失败时回收完整进程树并拒绝 PID 复用。

保留 Web 预检 shutdown 的结构化清理诊断,补充身份不匹配回归测试。
Merge remote-tracking branch 'origin/master' into fix/web-preflight-browser-recovery
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m3s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 4m56s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m4s
Project CI / Backend tests (pull_request) Successful in 5m59s
Project CI / Frontend tests (pull_request) Successful in 2m52s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m5s
Project CI / Native shell tests (pull_request) Successful in 6m37s
Project CI / Repository checks (pull_request) Successful in 6m24s
c7d70ba893
suzmii merged commit 7e96b369c1 into master 2026-10-03 17:33:22 +08:00
suzmii deleted branch fix/web-preflight-browser-recovery 2026-10-03 17:33:23 +08:00
Sign in to join this conversation.