Skip to content

emrg: DaemonClient ensureConnected skipStart option (GUI multi-session rant P2 first slice) - #623

Merged
argszero merged 1 commit into
masterfrom
feature/gui-skipstart
Aug 10, 2026
Merged

emrg: DaemonClient ensureConnected skipStart option (GUI multi-session rant P2 first slice)#623
argszero merged 1 commit into
masterfrom
feature/gui-skipstart

Conversation

@argszero

Copy link
Copy Markdown
Owner

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 → throws daemon not running (skipStart): no port file at ... instead of spawning
  • skipStart: true + stale port + daemon dead (G43 path) → throws daemon unreachable (skipStart) instead of deleting the port file and respawning (port file preserved for connManager restart-recovery detection)

Tests (+2 daemon_client, 29→31):

  • missing port file + skipStart → rejects, startDaemon never called
  • stale port + dead daemon + skipStart → rejects, no spawn, port file kept

Doc counts synced 111→113 (README/README.cn/Agent). 680 pytest + 113 GUI green.

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

@pm25coder

Copy link
Copy Markdown
Contributor

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

@argszero
argszero merged commit 2a202ec into master Aug 10, 2026
1 check passed
argszero added a commit that referenced this pull request Aug 10, 2026
…entries (#625)

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
@argszero
argszero deleted the feature/gui-skipstart 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