Repository navigation
Fix WSL join liveness detection - #512
Merged
Merged
Conversation
This was referenced May 5, 2026
There was a problem hiding this comment.
Pull request overview
This PR addresses incorrect monitor liveness detection on Windows/WSL (notably when running under Claude Code Monitor) so airc status / airc msg don’t falsely report “monitor down” when the join wrapper is actually alive, and it hardens airc version output formatting.
Changes:
- Add pidfile PID validation helpers in
aircto identify live “monitor wrapper” PIDs, including a WSL/Monitor-compatible command-line shape. - Update
cmd_statusto report the verified live PID (rather than the first raw pidfile token) and guard empty PID checks. - Add an integration regression test covering WSL wrapper liveness and multi-PID pidfiles; update
versionoutput to useprintfwith fallbacks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
airc |
Adds helper(s) to extract verified live monitor-wrapper PIDs from airc.pid and uses them in _monitor_alive_with_bearer_fallback. |
lib/airc_bash/cmd_status.sh |
Reports a verified live PID from the pidfile (via new helper) and avoids kill -0 on an empty PID. |
lib/airc_bash/cmd_update.sh |
Uses printf and fallback values to make airc version output more robust. |
test/integration.sh |
Adds #511 regression coverage for WSL-style wrapper command lines and multi-PID pidfiles. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+513
to
+520
| echo "$cmd" | grep -Eq '(^|[[:space:]])/[^[:space:]]*/airc[[:space:]]+(connect|join)([[:space:]]|$)|(^|[[:space:]])airc[[:space:]]+(connect|join)([[:space:]]|$)|eval .*airc[[:space:]]+(connect|join)' \ | ||
| && return 0 | ||
|
|
||
| # WSL/Claude Monitor can preserve only the script path in `ps` even | ||
| # though the PID came from this scope's airc.pid. Accept that narrower | ||
| # shape only after pidfile ownership + kill -0 have already been proven | ||
| # by the caller. | ||
| echo "$cmd" | grep -Eq '(^|[[:space:]])/[^[:space:]]*/airc([[:space:]]|$)|(^|[[:space:]])airc([[:space:]]|$)' |
Comment on lines
+519
to
+520
| # by the caller. | ||
| echo "$cmd" | grep -Eq '(^|[[:space:]])/[^[:space:]]*/airc([[:space:]]|$)|(^|[[:space:]])airc([[:space:]]|$)' |
Comment on lines
555
to
+560
| # Fix: a PID is only "ours" if `kill -0` says alive AND its cmdline shapes | ||
| # like an airc connect/join wrapper. Same regex shape as cmd_teardown's | ||
| # parent-chain reaper (#446) — keeps the two paths in lockstep on what | ||
| # "an airc process" means. PID reuse → cmdline doesn't match → treat as | ||
| # dead, fall through to Phase 2 (scope formatter process evidence). | ||
| # like an airc wrapper. Same shape as cmd_teardown's parent-chain reaper | ||
| # (#446), with one WSL/Claude Monitor allowance: if the PID came from this | ||
| # scope's pidfile, a visible /path/to/airc wrapper is enough even when `ps` | ||
| # drops the join/connect argument. PID reuse → cmdline doesn't match → | ||
| # treat as dead, fall through to Phase 2 (scope formatter process evidence). |
| local pidfile="${1:-}" | ||
| [ -f "$pidfile" ] || return 0 | ||
| local p raw | ||
| raw=$(cat "$pidfile" 2>/dev/null) |
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
Fixes #511.
Tests
Windows Retest
After this lands on canary, Windows should run:
airc update --channel canary airc join airc version airc status airc daemon status airc msg --channel general "windows ops-ok $(date -u +%FT%TZ)"Expected: status reports a running AIRC process or formatter for the scope, and msg does not refuse with monitor down while the Monitor stream is alive.