generated from eblume/project-template
Reconnect the socket client across daemon restarts (heph-tui survives self-update) #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/client-reconnect"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
hephd::Clientopened the unix socket once atconnect()and never reconnected — it didn't even keep the socket path. So when the daemon restarted (opt-in self-update, now at a 600s interval on gilbert, orheph daemon restart), the stream broke and every subsequentcall()failed:heph-tuiwould sit onerror: …until you quit and relaunched. The self-update + restart work shipped in v1.4.0 makes those restarts more frequent, so this hardening is the natural follow-on.Clientnow stores the socket path and reconnects on a dropped connection, classifying the failure to stay correct:heph-tuiand the CLI useClientunchanged, so the TUI self-heals on its next refresh tick — no heph-tui code change, lower risk, and the CLI benefits too.Testing
tests/client_reconnect.rs: a mock daemon that closes the connection after each request; asserts the client recovers (within a call or two), the recovered call is served exactly once (no double-serve), and it keeps recovering across repeated drops.cargo test --workspacegreen (incl. the existing 17rpc_sockettests, unchanged);cargo clippy -p hephd --all-targetsclean; fmt + prek pass.Closes
01KTAKXZ…— "heph-tui: reconnect on a dropped daemon socket (survive hephd restarts / self-update)"🤖 Generated with Claude Code