emrg: ConnManager open/close/get — GUI multi-session rant P2 slice 2 - #624
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-154529
Verified locally: 5/5 conn-manager tests pass (bootstrap→skipStart→resume_session flow with payload assertions; same-sid reuse; close semantics; closeAll), full GUI suite 116 (29 dc + 5 cm + 22 + 32 + 15 + 7 + 3 + 3), 680 pytest + import + CLI + node --check all green.
79256f9 to
d15ba3dCompare
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-155346
Verified on feature/conn-manager (rebase-conflict resolved onto master 2a202ec; doc counts corrected to the true rebased value):
- Full GUI suite: 118 passed / 0 failed (31 daemon_client + 5 conn-manager + 22 app-commands + 32 renderer smoke + 15 i18n + 7 integration + 3 commands + 3 build-config — counts verified against the actual run).
- Full pytest: 680 passed; import check OK.
- All 5 conn-manager tests pass: open bootstraps daemon + skipStart session + resume_session payload {session_id, cwd}; same-sid reuse (no duplicate resume_session); get null for unopened; close disconnects+removes+double-close false; closeAll.
- Design check:
_ensureDaemonbootstrap then closes; session conns useensureConnected({ skipStart: true })(never spawn — matches #623 contract); port-file isolation guard present in test harness. main.js not rewired yet (contract slice only) — as stated. - No workflow changes.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-155914
Re-verified on current state: head d15ba3d unchanged since cycle 155346 review (rebase-conflict resolved onto master 2a202ec, doc counts 118 verified against actual 118/118 npm test run; pytest 680; import OK). PR CI 31367938221 SUCCESS, mergeable. 3 consecutive ✅ from distinct cycles (154529 / 155346 / 155914), no ❌ — merge condition met.
Uh oh!
There was an error while loading. Please reload this page.
pm25coder
commented
Aug 10, 2026
I tested this PR on Windows (zh-CN): checked out feature/conn-manager, ran `npm test` in emrg/gui → 118 pass / 0 fail (including the 5 new conn-manager tests), and `uv run pytest tests/` → 625 passed + 55 skipped = 680. The ConnManager contract works as described: open() bootstraps the daemon then connects the session with skipStart, resume_session carries {session_id, cwd}, same-sid reuse skips a second resume_session, close disconnects + removes, double-close returns false, closeAll empties the map. |
…entries (#625) Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Second slice of P2 (connection layer) from the GUI multi-session rant (2026-08-10T15:07:19): new
ConnManagermodule — the daemon-lifecycle owner with one DaemonClient per open session (each session = one independent websocket connection, aligned with the TUI multi-open model).New
emrg/gui/conn-manager.js:open(sid, projectPath): bootstrapensureConnected()(daemon lifecycle owner — spawn if missing, connect if running, then close the bootstrap) → new DaemonClient →ensureConnected({ skipStart: true })(only connects to the now-running daemon) →resume_session(sid, cwd=projectPath)auto-subscribes → store. Already-open sid → reuse (no duplicate connection, per P4 semantics).close(sid)/get(sid)/all()/closeAll(): disconnect + remove, route, list, teardown.Tests (+5 conn-manager, GUI 111→116): open bootstraps daemon + skipStart session + resume_session payload {session_id, cwd}; same-sid reuse (no second resume_session); get null for unopened; close disconnects + removes + double-close false; closeAll.
Doc counts synced (README/README.cn/Agent). 680 pytest + 116 GUI green.