Skip to content

Make attach mode own UI only - #514

Merged
joelteply merged 1 commit into
canaryfrom
codex/fix-wsl-monitor-attach-contract
May 5, 2026
Merged

joelteply merged 1 commit into
canaryfrom
codex/fix-wsl-monitor-attach-contract

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

  • make Claude /join invoke airc join --attach explicitly instead of relying on parent-chain detection across WSL
  • change attach mode so it starts a scope-local background transport with AIRC_BACKGROUND_OK=1, verifies liveness, then execs the local UI attach stream
  • add AIRC_NO_ATTACH for the internal child transport so it cannot recursively attach
  • add an integration scenario proving attach mode starts verified background transport and keeps the UI stream active

This is a follow-up for #511 after Windows showed that the Claude Monitor wsl bash -lc airc join wrapper can disappear and leave no WSL-side airc/python processes alive. The new model makes the Monitor process UI-only; the transport is a project-scope airc process managed by airc quit / airc teardown, not an OS daemon.

Tests

  • bash -n airc lib/airc_bash/cmd_connect.sh test/integration.sh
  • git diff --check
  • python3 test/test_monitor_formatter.py && python3 test/test_scope_repair.py
  • ./airc doctor --tests python_units
  • bash test/integration.sh send_dead_monitor_dies
  • bash test/integration.sh attach_starts_background_transport
  • local no-GitHub attach smoke: airc join --attach --no-room --no-gist => status reported AIRC background process running; teardown cleaned it

Windows retest

After merge to canary:

airc update --channel canary
airc join --attach
airc version
airc status
airc msg --channel general "windows ops-ok $(date -u +%FT%TZ)"

Expected: airc status shows an AIRC process running even if the Claude Monitor wrapper would otherwise disappear, and airc msg does not refuse with monitor down.

Copilot AI review requested due to automatic review settings May 5, 2026 05:20
@joelteply
joelteply merged commit 445ceb4 into canary May 5, 2026
8 checks passed
@joelteply
joelteply deleted the codex/fix-wsl-monitor-attach-contract branch May 5, 2026 05:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reworks airc join --attach so that Claude/WSL Monitor acts as a UI-only stream while a scope-local background airc join process owns transport lifetime, improving reliability on Windows/WSL where the wrapper shell can disappear.

Changes:

  • Updates the Claude /join skill contract to invoke airc join --attach explicitly.
  • Implements attach mode that spawns a background scope transport (AIRC_BACKGROUND_OK=1, AIRC_NO_ATTACH=1), verifies liveness, then execs a local log tail UI attach stream.
  • Adds an integration scenario intended to prove attach mode starts verified background transport and keeps the UI stream alive.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
lib/airc_bash/cmd_connect.sh Adds the attach-mode background transport spawn + liveness verification before attaching the UI stream.
airc Exports AIRC_SELF so attach mode can re-invoke the airc script reliably.
skills/join/SKILL.md Changes required Claude Monitor invocation from airc join to airc join --attach.
test/integration.sh Adds attach_starts_background_transport scenario to validate the new attach behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/integration.sh
local seen=0 status_out="" i
for i in $(seq 1 20); do
status_out=$(AIRC_HOME="$home" "$AIRC" status 2>&1 || true)
if echo "$status_out" | grep -qE 'airc process:\s+AIRC background process running for scope'; then
Comment thread skills/join/SKILL.md
Monitor(persistent=true, description="airc", command="airc join")
Monitor(persistent=true, description="airc", command="airc join --attach")
```
Keep `description="airc"` — the headline shown in the UI is built from it. Plain `airc join` creates the live AIRC stream for the scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants