emrg: ConnManager daemon restart recovery (GUI multi-session rant P2 slice 4) - #627
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-161305
Verified locally: 8/8 conn-manager tests pass (restart detection both states: all-drop→auto-recover vs single-drop→none; recoverAll re-opens + re-subscribes all sessions with mock driving; stale-connection exclusion prevents false counts), 680 pytest + import + CLI + node --check green.
…c counts to 127 (37 dc + 8 cm + 22 + 32 + 15 + 7 + 3 + 3)
|
I reviewed this PR (P2 slice 4 — daemon restart recovery) and found it is currently CONFLICTING with master. The conflict is purely positional in the doc-count lines: the branch base is c472a21 (pre-#626), so Agent.md/README.md/README.cn.md say `121: 31 daemon_client + 8 conn-manager + ...`, but master is now at 95cdea4 (#626 delta batching merged, 118→124), so the current totals are `124: 37 daemon_client + 5 conn-manager + ...`. |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-162002
Conflict resolved and re-verified on the updated branch (d3c5965, merged master 95cdea4): doc counts resolved to the true 127 (37 daemon_client + 8 conn-manager + 22 + 32 + 15 + 7 + 3 + 3 — 118 base + 6 from #626 + 3 from this PR). Local verification: GUI suite 127/127 (3 new conn-manager tests: all-drop window → restart detect + auto recoverAll with single-drop negative state; single-drop never triggers; recoverAll re-opens + re-subscribes with stale-connection exclusion), 680 pytest green, doc-count guard 3/3. Design matches rant spec: short-window all-drop → restart detect → recoverAll via open() sequence; _recovering guard prevents close→disconnect recursion.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-162110
Re-verified on head d3c5965 (post-rebase): local GUI suite 127/127 (8/8 conn-manager tests — all-drop window triggers restart detection + auto recoverAll; single-drop negative state; recoverAll re-opens + re-subscribes both sessions with stale-connection exclusion in the mock driver), 680 pytest green (doc-count guard reads 37 dc + 8 cm + 22 + 32 + 15 + 7 + 3 + 3 = 127), node --check clean. PR CI 31369797451 SUCCESS. Merge commit correctly resolves the #626 doc-count positional conflict to the verified actual 127.
…entries (#628) Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Fourth slice of P2 (connection layer) from the GUI multi-session rant (2026-08-10T15:07:19):
connManager 监听所有连接断开 → 短窗口(1s)多连接同时断 → 判定重启 → 等 daemon 就绪 → 所有 sessionConn 重连 + 重新订阅(复用 open 序列);单条断 → 独立退避重试.Changes (
emrg/gui/conn-manager.js):disconnectedlistener on open → records disconnect timestamp_restartDetected(): all currently-open sessions dropped within the restart window (default 1s) → daemon restart_onDisconnect(sid): on full-window drop, auto-invokesrecoverAll()(fire-and-forget with error logging); single drop → no restart detection (left to per-connection backoff, later slice)recoverAll(): closes all session conns → re-opens each via the open() sequence (bootstrap daemon-ready → skipStart session connect → resume_session re-subscribe); per-session failures logged and skipped (don't block the rest);_recoveringguard prevents recursion from close→disconnect→recoverAllrestartWindowMsconfigurable for testsTests (+3 conn-manager, 5→8): all-drop within window → restart detected + auto recoverAll (single drop does NOT trigger); single-drop never detects; recoverAll re-opens + re-subscribes all sessions (mock-driven, stale-connection exclusion to avoid false counts).
Doc counts synced 118→121 (README/README.cn/Agent). 680 pytest + 121 GUI green.