feat(status): warn when the daemon is running an older config#102
Merged
Conversation
e7c4a3f to
d1b34eb
Compare
636e3c4 to
e585c99
Compare
4b0569c to
f9fed60
Compare
This was referenced Jun 17, 2026
e585c99 to
18f331e
Compare
db031c5 to
15cc467
Compare
- daemon replies to a config-hash socket query with its loaded config fingerprint - status compares it to settings.json and warns to restart on drift (no disk write) - socket server gains allowHalfOpen to reply; every branch closes the socket Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
18f331e to
f6dd39e
Compare
drtangible
approved these changes
Jun 17, 2026
HiveMind Sessions1 session · 5m · $1.53
View all sessions in HiveMind → Run |
- isControlMessage: prove object-ness before reading `command` instead of casting to the target type within the guard - DaemonConfig: un-export; the type flows to `status` via inference through resolveDaemonConfig/daemonConfigFingerprint - formatting: expand the socket end-handler guard clauses and the requestFromSocket timeout to multi-line Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Converts DaemonConfig and the other plain object shapes in daemon.ts (ControlMessage, PendingToolCall, ActiveChatSpan, SubagentTracker, TeamMember, SessionState) from interface to type for consistency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the
statusdrift warning, using a socket query instead of a file so nothing is written to disk and the daemon's loaded config stays purely in memory.When a daemon is alive but loaded a different config than
settings.jsonnow resolves to,statusprints (right under the agent-name line from #103):How it works
config-hashcontrol message over its existing socket with a fingerprint of the config it loaded (the API key is hashed, never sent).statusqueries it, computes the current fingerprint fromsettings.json, and warns on mismatch. Any error or missing reply (for example an older daemon) leaves the warning off, sostatusnever breaks.allowHalfOpenso it can reply after the client half-closes. Every branch now closes the socket explicitly, so the high-frequency hook-event path still ends promptly.New exports (why)
resolveDaemonConfig/daemonConfigFingerprint/DaemonConfig(daemon.ts): exported sostatuscomputes the fingerprint exactly the way the daemon does, from one shared resolver rather than duplicated precedence logic.resolveDaemonConfigalso replaces the inline resolution inrunDaemon.requestFromSocket(utils.ts): a reply-reading sibling ofsendToSocket, sostatuscan query the daemon and read itsconfig-hashresponse.Tests
npm run check: 64 pass, clean build. Addstests/config-drift.test.ts(fingerprint unit,statuswarning via a stand-in server, and an end-to-end check against a real daemon). The existing hook-handler and daemon-signal integration tests still pass, confirmingallowHalfOpendid not regress event forwarding.Stack
Top of a 3-PR stack: restart (#101) -> surface
agent_namein status (#103) -> this. Based on #103's branch; retarget down the stack as each merges.🤖 Generated with Claude Code