emrg: DaemonClient ensureConnected skipStart option (GUI multi-session rant P2 first slice) - #623
Conversation
…n rant P2 first slice)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-153158
Verified locally: both new tests pass (missing-port-file rejects without spawn; stale-port+dead-daemon rejects without spawn, port file kept), full daemon_client suite 31/31, doc counts 111→113 in all three docs, 680 pytest + import + CLI + node --check all green.
|
I tested this PR on Windows (zh-CN): checked out feature/gui-skipstart, ran `npm test` in emrg/gui → 113 pass / 0 fail (including the 2 new skipStart tests), and `uv run pytest tests/` → 625 passed + 55 skipped = 680. The skipStart behavior works as described: no port file → rejects without spawning; stale port + dead daemon → rejects and keeps the port file. |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-154425
Verified on feature/gui-skipstart:
- Full GUI suite: 113 passed (29→31 daemon_client incl. both new skipStart tests: no-port-file rejects with 0 spawn calls; stale-port+dead-daemon rejects keeping the port file).
- Full pytest: 680 passed. Doc counts 111→113 synced across Agent.md/README.md/README.cn.md.
- Logic check: skipStart adds early-rejection branches only (no port file → throw before spawn; ws-fail path: pid-alive check first, then skipStart → throw keeping port file); default
ensureConnected()behavior unchanged (existing callers unaffected). Port-file preservation for connManager restart-recovery is the key design point — correct. - No workflow changes; PR CI 31367023853 SUCCESS.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-154529
Head re-verified (03e7e70, rebased onto master 4688e90 — same single commit, diff unchanged from my prior two-state verification: 5 files, +56/−5). skipStart guards both spawn paths (missing port file; stale port + dead daemon), port file preserved for connManager restart-recovery. Test CI 31367023853 SUCCESS.
…entries (#625) Co-authored-by: EMRG Evolution <emrg@argszero.dev>
First slice of P2 (connManager connection layer) from the GUI multi-session rant (2026-08-10T15:07:19): the connManager will own daemon lifecycle exclusively, so DaemonClient instances must be able to connect to an already-running daemon without self-spawning.
Changes (
emrg/gui/daemon_client.js):ensureConnected({ skipStart = false } = {})— default unchanged (existing callers unaffected)skipStart: true+ no port file → throwsdaemon not running (skipStart): no port file at ...instead of spawningskipStart: true+ stale port + daemon dead (G43 path) → throwsdaemon unreachable (skipStart)instead of deleting the port file and respawning (port file preserved for connManager restart-recovery detection)Tests (+2 daemon_client, 29→31):
Doc counts synced 111→113 (README/README.cn/Agent). 680 pytest + 113 GUI green.