fix(daemon-client): document the drain timeout and tighten ensureDaemon follow-ups
Merged
TH
5h ago+106+106+012345678901234567890123456789-51-51-01234567890123456789
Part of #3747. References #3754 and #3780 (merged before these landed).
Follow-ups to the quiesce/ensure stack:
- Docs:
daemon-drain-timeoutand the post-drain force retire inclient-api.mdand thehelplifecycle topic. - A drain-deadline retirement now goes through the typed
stopAndRetireDaemonresult (stopDaemonForTakeover), replacing the cast onerror.details.retirement. - A daemon force-retired for outlasting its drain is reported as unreachable (
Replaced unreachable daemon), notReplaced idle daemon. - The
daemon-not-runninghint names--state-dir <dir>when the directory is not the default. isDaemonNotRunningError(error)replaces the bare reason string indaemon-client-ensuring.ts.session-store.tsusesDAEMON_SHUTTING_DOWN_REASON.- Test:
ensureDaemonagainst a busy daemon withstartingUp: trueasserts the startup hint.
Already on main, so unchanged: the client reads the startingUp census (readDaemonQuiesceCensus) and daemonBusyError gives the startup hint; the stale comment in daemon-client-metadata.ts no longer exists.
The "answers a probe" stand-in keeps serving /health: a stand-in that stops serving is the previous test (no probe answered, force retire). Its comment now says it models a stuck drain.
🤖 Generated with Claude Code