emrg: GUI multi-session P6 finalize — cancel-before-close + cap-20 prompt + projectPath validation - #643
Conversation
…ompt + projectPath validation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-184049. P6 finalize: cancel-before-close in ConnManager.close (busy streams stopped cleanly), cap-20 explicit-open guard with localized prompt (creation paths unblocked), projectPath validation. GUI 175/175, pytest 680, doc counts synced.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-184923. Verified locally: GUI npm test 175/175 (conn-manager busy-close cancel / idle-close no-cancel, renderer over-limit localized prompt), pytest 680. Symbols verified: DEFAULT_CAP exported from gui-state.js, daemon supports 'cancel' (daemon.py:515), ownStream tracked on DaemonConnection (daemon_client.js:99). Doc counts synced (43+19+22+56+15+7+3+3+7=175). CI 31380737948 SUCCESS.
P6 finalize of the GUI multi-session rant (2026-08-10T15:07:19) — boundary hardening after P5 (#641/#642 merged).
1. Cancel in-flight stream before closing a busy connection (boundary: "关闭在忙连接先 cancel 再 close")
ConnManager.close(sid)now detectsconn.ownStream && conn.wsand sendscancelbefore disconnecting (fire-and-forget, swallow disconnect errors — sync close semantics preserved). Prevents dirty state from mid-stream disconnects.2. Over-limit (20) prompt — don't auto-close (acceptance: "上限 20:超限提示不自动关")
switchSessionrejects with "too many open sessions (20) — close some first" when explicitly opening a NEW session at the cap (openSessions.size >= DEFAULT_CAP && !openSessions.has(sid)); already-open sids are reused without blocking; creation paths (sendMessage auto-open, newSession) are never blocked.app.tooManyOpenSessions(zh/en) instead of leaking the raw English error.3. projectPath validation (boundary: "projectPath 校验")
switchSession/newSessionIPC validateprojectPathis a non-empty string when provided.+3 tests: conn-manager 17→19 (busy close sends cancel / idle close doesn't), renderer.smoke 55→56 (localized over-limit message). GUI 172→175, 680 pytest green, doc counts synced.