harden remote daemon recovery and log draining - #269
Open
damienrj wants to merge 5 commits into
Open
Conversation
kalvinnchau
reviewed
Sep 1, 2026
kalvinnchau
reviewed
Sep 1, 2026
kalvinnchau
reviewed
Sep 1, 2026
kalvinnchau
reviewed
Sep 1, 2026
kalvinnchau
reviewed
Sep 1, 2026
kalvinnchau
reviewed
Sep 1, 2026
morgmart
requested changes
Sep 2, 2026
morgmart
left a comment
Collaborator
There was a problem hiding this comment.
🤖 Automated code review
REQUEST_CHANGES: the new Forget lifecycle can be undone by already-admitted frontend status work, allowing a forgotten host to reappear, and expected Forget refusals have no visible feedback. Supplied GitHub evidence is structurally available and all listed checks completed successfully, but required checks independently govern merge readiness.
Deterministic publication result: 1 blocking and 1 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.
damienrj
force-pushed
the
codex/fix-remote-daemon-recovery
branch
from
September 2, 2026 07:29
742fbb5 to
639e59e
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.
Category: fix
User Impact: Remote SSH sessions recover reliably after interrupted cleanup, tolerate noisy startup logs, and let users remove broken ad-hoc hosts.
Problem: A crashed stale-lock reclaimer could block every future remote daemon operation, the chunked logger could backpressure Goose before it bound its port, and failed free-form hosts could become permanent settings rows. Solution: Reclaim lock generations atomically, drain startup logs through a native-speed bounded reader, and provide a terminal-state Forget operation that clears both backend and persisted UI state.
File changes
src-tauri/src/commands/remote_backend.rs
Exposes the inactive-host forget operation to the renderer.
src-tauri/src/lib.rs
Registers the new remote backend command.
src-tauri/src/services/remote_backend/daemon.rs
Adds deterministic kill-during-reclaim coverage and preserves the bounded-tail and 5 MiB pre-bind startup regressions.
src-tauri/src/services/remote_backend/mod.rs
Removes inactive host slots without allowing active connections to be orphaned, with focused registry tests.
src-tauri/src/services/remote_backend/remote_daemon.sh
Reclaims stale lock generations with one atomic rename and replaces the process-heavy chunk logger with a native-speed bounded FIFO reader.
src/features/remoteHosts/stores/remoteHostStore.test.ts
Covers complete cleanup of a broken host and preservation of local state when the backend rejects an active-host removal.
src/features/remoteHosts/stores/remoteHostStore.ts
Forgets backend state plus all persisted per-host metadata, including diagnostics, recent directories, and Goose overrides.
src/features/remoteHosts/ui/RemoteHostsSettings.tsx
Shows Forget for failed or disconnected ad-hoc hosts while leaving SSH-config hosts managed by SSH config.
src/features/remoteHosts/ui/tests/RemoteHostsSettings.test.tsx
Regresses the invalid free-form host case and verifies SSH-config hosts do not expose Forget.
src/shared/api/remoteHosts.ts
Adds the typed renderer wrapper for forgetting an inactive backend.