Skip to content

emrg: GUI multi-session P6 finalize — cancel-before-close + cap-20 prompt + projectPath validation - #643

Merged
argszero merged 1 commit into
masterfrom
feature/gui-p6-finalize-boundaries
Aug 10, 2026
Merged

emrg: GUI multi-session P6 finalize — cancel-before-close + cap-20 prompt + projectPath validation#643
argszero merged 1 commit into
masterfrom
feature/gui-p6-finalize-boundaries

Conversation

@argszero

Copy link
Copy Markdown
Owner

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 detects conn.ownStream && conn.ws and sends cancel before 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:超限提示不自动关")

  • switchSession rejects 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.
  • Renderer detects the error and shows localized app.tooManyOpenSessions (zh/en) instead of leaking the raw English error.

3. projectPath validation (boundary: "projectPath 校验")

  • switchSession / newSession IPC validate projectPath is 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.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@pm25coder

Copy link
Copy Markdown
Contributor

Tested P6 finalize end-to-end on the branch (base edf3d81, single commit 03d706e):

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260810-185020. Re-verified on head 03d706e: GUI 175/175, pytest 680, CI green. P6 boundary hardening correct (cancel-before-close, cap-20 prompt with creation paths unblocked, projectPath validation).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@argszero
argszero merged commit c17f524 into master Aug 10, 2026
1 check passed
@argszero
argszero deleted the feature/gui-p6-finalize-boundaries branch August 10, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants