Repository navigation
Conversation
`wire mcp` spawns a detached `wire daemon` in a by-key session home, but nothing tied the daemon to the session: once the Claude session and its mcp exited, the daemon was reparented to init and polled forever (107 of them on one host). PR #378 bounds this only in supervisor mode. In single-home mode, for by-key homes only, the daemon now exits cleanly (daemon.pid removed by the existing guard) after 3+ consecutive ticks over 60s+ in which mcp.pid is missing/dead (or its pid was reused by a non-wire process on Linux), the home has no pinned peers, and the outbox is empty. A returning mcp resets the counter. Machine-default homes and supervisor mode are unchanged. WIRE_DAEMON_NO_ORPHAN_EXIT=1 disables the exit. Model: claude-sonnet (claude -p --model sonnet) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Deploying wireup-landing with
|
| Latest commit: |
de69290
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f5f19b9a.wireup-landing.pages.dev |
| Branch Preview URL: | https://fix-session-daemon-exit-when.wireup-landing.pages.dev |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
Successful delivery leaves <peer>.pushed.jsonl behind, so a dead session with no peers never counted as orphaned. Only non-empty <peer>.jsonl queue files count as pending outbound. Model: claude-sonnet Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The supervisor respawns any worker that exits, so a by-key worker with no MCP, no peers and an empty outbox looped exit/respawn every 60s. Gate the orphan exit on WIRE_SUPERVISOR_MANAGED. Model: claude-sonnet Co-Authored-By: Claude Sonnet 5.5 <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 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.
Problem
Every Claude Code session starts
wire mcp, which spawns a detachedwire daemon --interval 5in a session-keyed home (sessions/by-key/<hash>). Nothing ties that daemon's life to the session. When the session and itswire mcpexit, the daemon is reparented to init and polls forever (107 such daemons on one host). #378 bounds this only in supervisor mode (--all-sessions), which does not run here.Fix
In the single-home daemon loop (
src/cli/relay.rs), for by-key homes only, the daemon exits cleanly when ALL hold for 3+ consecutive ticks spanning 60s+:state/wire/mcp.pidis missing or its pid is dead (on Linux a live pid whose cmdline lackswirecounts as reused);A returning mcp resets the counter.
daemon.pidis removed by the existingDaemonPidGuard. Machine-default homes and supervisor mode are unchanged.WIRE_DAEMON_NO_ORPHAN_EXIT=1disables the exit. Helpers and debounce live insrc/ensure_up.rs.Limitation: pid-reuse check is a cmdline heuristic on Linux only;
mcp.pidrecords no process start time.Tests
cargo build: okcargo test --lib ensure_up: 12 passed, 0 failed (includes neworphan_tracker_needs_ticks_and_time_and_resets)cargo clippy -- -D warnings: not run, clippy not installed on this hostAuthor model: claude sonnet
Review log
🤖 Generated with Claude Code