Repository navigation
Conversation
The daemon's RPC layer answers a handler that throws with an ordinary
reply carrying `error` (RpcHandlerManager.handleRequest), not with a
failed call. machineResumeSession already checks for it;
machineStopSession did not, so a daemon that does not know the session
("Session not found or failed to stop") came back as success.
Its callers fall back to the session's own kill RPC, and then to the
server archive, when the daemon cannot stop a session. Those fallbacks
never ran for a session the daemon was not tracking, so the session
was left running while the app went on as if it had stopped.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This branch has not been deployed
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.
machineStopSessionreports success when the daemon answers "Session not found or failed to stop": the daemon's RPC layer returns a handler that throws as an ordinary reply with anerrorfield (RpcHandlerManager.handleRequest), not as a failed call.machineResumeSessionalready checks for that field; this adds the same check, so every caller's fallback — the session's ownkillSession, then the server archive — actually runs when the daemon does not know the session. That is the case for every session after a daemon restart, which each CLI upgrade does, and until now the fallback was silently skipped and the session left running.Proof
sources/sync/ops.stopSession.test.ts(new): the daemon-error case fails onmainand passes with this change;ops.resume.test.tsstill passes, and so does the whole app suite on a branch with this and feat(app): add Restart Session to the session menu #1854 applied (1922 tests;sessionPresentation.test.tsfails to load onmaintoo,__DEV__ is not defined).Session … may still have a running process from a previous daemon. After: the daemon'snot foundreads as a failure, the session's own kill runs (Kill session request receivedin its log), and the session is resumed 0.5 s after the press with the conversation intact.