fix(session): mark session Stopped even when daemon is unreachable#639
Merged
fix(session): mark session Stopped even when daemon is unreachable#639
Conversation
When the daemon isn't running, `kild stop` would fail with DaemonError and leave the session stuck Active on disk. The early return at stop.rs:124 fired before the session status was updated. Consolidate the `is_daemon_unreachable` check from list.rs into a proper `is_unreachable()` method on DaemonClientError. Use it in both stop_session() and stop_teammate() to treat unreachable daemon errors (NotRunning, ConnectionFailed, ProtocolError, Io) as "PTY already dead" instead of blocking the stop flow.
Owner
Author
PR Review SummaryReviewed by: code-reviewer, pr-test-analyzer, silent-failure-hunter, type-design-analyzer, code-simplifier Critical Issues (0 found)None. Important Issues (0 found)None. Suggestions (1 found)
Strengths
VerdictREADY TO MERGE Clean, focused refactor that fixes a real bug (stop failing when daemon is unreachable) with proper error classification, good test coverage, and no regressions. |
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.
Summary
is_daemon_unreachablehelper fromlist.rsintoDaemonClientError::is_unreachable()method on the error type itselfstop_session(), classify daemon errors at collection point — unreachable errors (NotRunning,ConnectionFailed,ProtocolError,Io) are treated as "PTY already dead" withwarn!instead of being pushed todaemon_errorsDaemonErrorprotocol errors where the daemon is alivestop_teammate()which had identical unconditional error mappingTest plan
cargo fmt --checkpassescargo clippy --all -- -D warningspassescargo test -p kild-corepasses (5 new tests for error classification)kild create test --daemon→ kill daemon →kild stop test→ session marked Stopped