Repository navigation
CLI: name the refused database when the socket is outside the state directory - #4406
Merged
Merged
Conversation
mstomar125
force-pushed
the
cli-refused-database
branch
2 times, most recently
from
November 30, 2026 07:14
13775d8 to
2f69f07
Compare
The CLI only looked for the incompatible-database marker beside the socket it dialled, so with NODESPACED_SOCKET pointing elsewhere (or a Windows pipe) it printed the generic 'Is the daemon running?' text instead of naming the refused database and the reason. It now tries the socket's directory, then the state directory it resolves itself. A marker found only in the latter is qualified with a note, since it records no socket and may belong to a different daemon. With no marker the message is unchanged. The marker-lookup tests inject the state directory, and the two in-process integration tests that dial a missing daemon point NODESPACE_HOME at an empty temp dir, so none depends on the developer's own state directory. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
cli-refused-database
branch
from
November 30, 2026 07:34
2f69f07 to
db089d2
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
When the daemon stops for an incompatible database, the CLI names the refused database and the reason even when the socket is not in the state directory (
NODESPACED_SOCKETredirected, or the Windows pipe). It looks for the marker beside the socket first, then in the state directory the CLI itself resolves. With no marker anywhere the message is unchanged.Work item: "The CLI names the refused database and the reason when the daemon stopped for an incompatible database".
Why
The marker was only read from the socket's directory. The daemon writes it under
<NODESPACE_HOME>/.nodespace, so a socket living elsewhere got the generic "Is the daemon running?" text. Reproduced with the builtnodespacebinary and a hand-written marker.Trade-off (wrong-daemon attribution)
The marker records no socket, so for a redirected socket the marker in the default state directory may belong to a different daemon. Choice made: keep the fallback (it is the only way the redirected-socket case can be helped), but when the marker was not found beside the dialled socket, the message appends a note that the socket is outside the NodeSpace state directory and, if a different daemon was started via
NODESPACED_SOCKET, to check that daemon's own state directory. A marker beside the socket, or for the Windows pipe, is stated without the note.Tests (packages/cli/src/lib.rs, connect_failure_tests)
None, generic message unchangedconnect_failure_message_matches_classificationmade hermetic (state directory injected)cli_integration::connect_refused_returns_friendly_error,wait::a_daemon_that_is_not_running_...) callisolate_state_dir(), which points NODESPACE_HOME at an empty temp dirMutation checks
Not verified
No real refusing daemon was run; markers were hand-written. The original validation setup is inferred (the report may have dropped the
.nodespacepath part, in which case the existing code already applied). Windows pipe path not exercised.🤖 Generated with Claude Code