Skip to content

fix(client): never use an incompatible daemon (protocol-keyed endpoint + health handshake) - #33

Merged
zackees merged 1 commit into
mainfrom
fix/31-daemon-protocol-handshake
Oct 31, 2026
Merged

zackees merged 1 commit into
mainfrom
fix/31-daemon-protocol-handshake

Conversation

@zackees

@zackees zackees commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Fixes #31

  • PROTOCOL = 2 in ghd-core::endpoint; bump on any request/response field change.
  • Endpoint, start lock and log are *-p<PROTOCOL>, so a pre-handshake daemon (bare endpoint file) or one on another protocol is invisible; the client starts its own daemon beside it. No daemon is ever killed.
  • /v1/health answers ok protocol=<n>; the client's start-path handshake requires an exact match.
  • Tests (RED first): stale daemon answering ok, a daemon on protocol 1, and a matching daemon, against a fake loopback server; endpoint file name is protocol-keyed.

…n health (#31)

A client never uses a daemon built for another protocol and never kills
one: the endpoint/lock/log files are named endpoint-p<PROTOCOL>, and
/v1/health answers 'ok protocol=<n>', which the start path checks exactly.
Old daemons (bare 'endpoint' file) are simply invisible to new clients.
@zackees
zackees merged commit 8b08898 into main Oct 31, 2026
20 checks passed
@zackees zackees mentioned this pull request Oct 31, 2026
@zackees
zackees deleted the fix/31-daemon-protocol-handshake branch November 5, 2026 05:56
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.

Client silently uses an older running daemon (version skew breaks gh parity)

1 participant