Repository navigation
feat(rooms): default-on #general sidecar — every join lands in BOTH rooms (closes #121) - #122
Conversation
…ooms (closes #121) Bare 'airc join' from a project repo now subscribes the tab to BOTH the auto-scoped project room (e.g. #useideem from useideem/*) AND #general simultaneously. This is the IRC mental model Joel called for: agents in their natural domain-specific room AND the lobby, so cross- project AI-to-AI coordination happens through the substrate without requiring tabs to leave their project context. Joel, 2026-04-26: 'all ais are in general AND their own domain specific room ... seems more ideal' / 'cross-pollinate between projects and ais can always leave any room or join or create others' / 'agents in charge of their own airc, intuitively, esp since it is so similar to IRC.' ## Implementation: sidecar-scope sibling The primary scope at AIRC_WRITE_DIR runs the project room as today. A child 'airc connect --room general' is forked with AIRC_HOME pointed at a sibling .general scope. The sidecar shares the visible nick (AIRC_NAME passed through) but has its own ssh_key and peer records. Recursion is prevented by AIRC_GENERAL_SIDECAR=1 which the spawned sidecar reads at the top of cmd_connect to skip its own sidecar. Stdout naturally distinguishes events: the python formatter prefixes each line with [#room_name], so '[#useideem] vhsm: ...' and '[#general] continuum-b741: ...' interleave through the same Monitor. cmd_teardown extended to clean BOTH scopes — primary's gist (existing logic) AND sidecar's gist + pidfile. Without this, killing the primary would orphan the #general gist and leave a sidecar process under the kernel reaper. ## Flag semantics (split from old --no-general alias) --no-room : disable substrate entirely; legacy 1:1 invite mode (use_room=0). Same as before. spawn_host etc in test harness uses this. --no-general : NEW — keep the project room but skip the lobby sidecar. Project-only focus mode. Previously this was an alias for --no-room — those have different meanings now and there's no graceful overlap. --room-only NAME : combo — explicit project room + no sidecar. Equivalent to --room NAME --no-general. AIRC_NO_GENERAL=1: env-var equivalent of --no-general. The test harness exports this globally (only sidecar tests unset it for their scope). Migration: spawn_host and other --no-general usages in test/integration.sh + integration READMEs + skills/list/SKILL.md were rewritten to use --no-room. Functionally equivalent to old behavior; just renamed for the new semantic split. ## Tests scenario_general_sidecar_default — 12 assertions: - Default-on: sidecar banner fires, .general scope dir created with room_name=general, sidecar PID is appended to primary's airc.pid and is alive. - Teardown: primary's teardown reaps the sidecar bash + pidfile. - --no-general: no sidecar banner, no .general scope dir. - --room-only NAME: hosts the named room, no sidecar. All other existing tests still pass (the global AIRC_NO_GENERAL=1 suppresses sidecar in their scope; verified scenario_auto_scope and scenario_resume_prints_connected_banner explicitly). ## Next (out of scope here) - airc msg --room <name> for cross-room broadcast from a single tab - airc dm @<peer> auto-resolving the peer's current host across rooms - Multi-room as the default for daemon installs (right now opt-in via the same --no-general semantics on the daemon's connect line) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Implements issue #121’s default multi-room presence by making airc join/connect subscribe to the auto-scoped project room plus a #general “sidecar” running in a sibling scope, and updates docs/tests for the new flag semantics.
Changes:
- Add a
#generalsidecar subprocess + sidecar-scope cleanup inairc, with new flag semantics (--no-general,--room-only,--no-room). - Update integration test harness to globally disable the sidecar (opt-in per scenario) and add a dedicated sidecar scenario.
- Refresh skills + integration READMEs to replace legacy
--no-general(old alias) with--no-room.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
airc |
Adds sidecar spawn helper, new room/sidecar flags, and teardown cleanup for sidecar scope. |
test/integration.sh |
Disables sidecar by default for tests; adds scenario_general_sidecar_default; updates legacy flag usage. |
skills/join/SKILL.md |
Updates join skill contract/docs for new default (project room + #general) and opt-outs. |
skills/list/SKILL.md |
Updates legacy invite-mode wording to --no-room. |
README.md |
Updates legacy fallback wording to --no-room. |
integrations/*/README.md |
Updates legacy invite-mode instructions to use --no-room. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [ -n "$_primary_name" ] && _env_args+=("AIRC_NAME=$_primary_name") | ||
| # Unset primary's AIRC_PORT so sidecar doesn't fight for the same port — | ||
| # primary has it bound already, sidecar's auto-bump-loop would land on | ||
| # +1, but better to start the sidecar from the canonical default and | ||
| # let it find its own free port without the conflict-detect dance. | ||
| ( env -u AIRC_PORT "${_env_args[@]}" "$0" connect --room general ) & |
There was a problem hiding this comment.
The sidecar subprocess doesn’t inherit the user’s --no-gist choice from the primary. If the user runs airc connect --no-gist ..., the primary won’t publish, but the sidecar still runs connect --room general with use_gist=1 and may create/delete a #general gist unexpectedly. Consider propagating the no-gist intent into the sidecar invocation (e.g., pass --no-gist when use_gist=0, or add an env toggle the sidecar can read).
| [ -n "$_primary_name" ] && _env_args+=("AIRC_NAME=$_primary_name") | |
| # Unset primary's AIRC_PORT so sidecar doesn't fight for the same port — | |
| # primary has it bound already, sidecar's auto-bump-loop would land on | |
| # +1, but better to start the sidecar from the canonical default and | |
| # let it find its own free port without the conflict-detect dance. | |
| ( env -u AIRC_PORT "${_env_args[@]}" "$0" connect --room general ) & | |
| local _sidecar_cmd=("$0" connect --room general) | |
| [ -n "$_primary_name" ] && _env_args+=("AIRC_NAME=$_primary_name") | |
| [ "${use_gist:-1}" = "0" ] && _sidecar_cmd+=(--no-gist) | |
| # Unset primary's AIRC_PORT so sidecar doesn't fight for the same port — | |
| # primary has it bound already, sidecar's auto-bump-loop would land on | |
| # +1, but better to start the sidecar from the canonical default and | |
| # let it find its own free port without the conflict-detect dance. | |
| ( env -u AIRC_PORT "${_env_args[@]}" "${_sidecar_cmd[@]}" ) & |
| # kill there. Without this, killing the primary leaves an orphan | ||
| # #general gist on the gh account AND an orphan sidecar process that | ||
| # the primary's pidfile descendant-walk wouldn't catch (sidecar's | ||
| # bash isn't a child of cmd_teardown — it was forked detached). |
There was a problem hiding this comment.
This comment says the primary pidfile descendant-walk wouldn’t catch the sidecar process, but the sidecar PID is appended to the primary scope’s airc.pid in spawn_general_sidecar_if_wanted, so it will be included in the main scope-aware kill. Updating the comment would avoid future confusion about why the extra sidecar-scope cleanup is needed (it’s mainly for sidecar gist + sidecar pidfile cleanup / flush semantics, not because teardown can’t see the PID).
| # kill there. Without this, killing the primary leaves an orphan | |
| # #general gist on the gh account AND an orphan sidecar process that | |
| # the primary's pidfile descendant-walk wouldn't catch (sidecar's | |
| # bash isn't a child of cmd_teardown — it was forked detached). | |
| # cleanup there as well. The sidecar PID is also appended to the | |
| # primary scope's airc.pid, so the main scope-aware kill can still | |
| # reach it; this extra block exists mainly to clean up sidecar- | |
| # specific gist/pidfile state and to preserve sidecar-scope flush | |
| # semantics. |
| grep -qE '^[0-9]+$' "$home1/airc.pid" \ | ||
| && pass "primary airc.pid has at least one entry" \ | ||
| || fail "primary airc.pid empty or malformed" | ||
|
|
||
| # Sidecar bash should be alive | ||
| local _sc_pid; _sc_pid=$(tail -1 "$home1/airc.pid" 2>/dev/null) |
There was a problem hiding this comment.
In this scenario the primary process is in HOST mode, where airc writes multiple PIDs on a single line ("$$ $PAIR_PID $_hb_pid" > airc.pid). grep -qE '^[0-9]+$' "$home1/airc.pid" will fail even when the pidfile is valid. Consider validating by extracting numeric tokens (e.g. tr ' ' '\n') or by checking the first field is numeric instead of requiring a whole line of digits.
| grep -qE '^[0-9]+$' "$home1/airc.pid" \ | |
| && pass "primary airc.pid has at least one entry" \ | |
| || fail "primary airc.pid empty or malformed" | |
| # Sidecar bash should be alive | |
| local _sc_pid; _sc_pid=$(tail -1 "$home1/airc.pid" 2>/dev/null) | |
| tr ' ' '\n' < "$home1/airc.pid" 2>/dev/null | grep -qE '^[0-9]+$' \ | |
| && pass "primary airc.pid has at least one entry" \ | |
| || fail "primary airc.pid empty or malformed" | |
| # Sidecar bash should be alive | |
| local _sc_pid; _sc_pid=$(tr ' ' '\n' < "$home1/airc.pid" 2>/dev/null | grep -E '^[0-9]+$' | tail -1) |
| Defaults (issue #121 multi-room presence): | ||
| - `airc join` (no args) puts you in **two rooms simultaneously**: | ||
| 1. The **project room** auto-scoped from the current cwd's git remote org (e.g. `useideem/authenticator` → `#useideem`, `cambrian/continuum` → `#cambriantech`). If no git remote, falls back to `#general`. | ||
| 2. `#general` (the lobby) — runs as a **sidecar** in a sibling scope so AIs cross-pollinate between projects. The visible nick is shared across both rooms. | ||
| - Auto-discovery: if a room already has a host on your gh account, the new tab joins. Otherwise it becomes the host. |
There was a problem hiding this comment.
The docs state that airc join always puts you in two rooms simultaneously, but the implementation intentionally skips spawning a sidecar when the primary room resolves to general (fallback when there’s no git remote / auto-scope). In that case you’ll only have a single #general subscription. Suggest softening this wording (e.g. “project room + #general when the project room is not already general”).
| # used to alias --no-room (disable substrate entirely); the | ||
| # behaviors are now distinct because dual-room presence is | ||
| # default and users need a way to opt out of just the lobby | ||
| # part without dropping back to legacy 1:1 invites. |
There was a problem hiding this comment.
Now that --no-general no longer disables the substrate (it only disables the #general sidecar), there are still user-facing strings later in cmd_connect that instruct --no-general for the legacy 1:1 flow. For example, the “Host a new mesh” hint printed when multiple invite gists exist currently suggests ... airc connect --no-general, but the correct flag is --no-room. Those messages/comments should be updated to match the new flag semantics to avoid sending users into the wrong mode.
| # used to alias --no-room (disable substrate entirely); the | |
| # behaviors are now distinct because dual-room presence is | |
| # default and users need a way to opt out of just the lobby | |
| # part without dropping back to legacy 1:1 invites. | |
| # no longer aliases --no-room. Users who want the legacy 1:1 | |
| # flow / no substrate behavior must use --no-room; --no-general | |
| # now only opts out of the #general sidecar while preserving the | |
| # project room presence. |
| # Suppress the #general sidecar globally for the test suite (issue #121). | ||
| # Default behavior on canary spawns a sibling .general scope alongside | ||
| # every airc connect; for tests that don't care about lobby presence | ||
| # the sidecar adds latency, port pressure, and stdout noise. Tests that | ||
| # DO exercise sidecar behavior `unset AIRC_NO_GENERAL` for their scope. | ||
| export AIRC_NO_GENERAL=1 |
There was a problem hiding this comment.
With the new sidecar scope layout, sidecar pidfiles live at paths like /tmp/airc-it-*/state.general/airc.pid, but cleanup_procs currently only walks /tmp/airc-it-*/state/airc.pid. If a sidecar process survives (e.g. a teardown regression, or the scenario fails mid-run), cleanup_dirs will delete the pidfile without killing the sidecar, leaving an orphan process that can interfere with later scenarios. Consider expanding the pidfile glob to also include sibling *.general (or more generally state*/airc.pid).
| [ "$room_name" = "general" ] && return 0 | ||
| [ "$use_room" = "1" ] || return 0 | ||
|
|
||
| local _primary_scope="$AIRC_WRITE_DIR" |
There was a problem hiding this comment.
spawn_general_sidecar_if_wanted decides whether to spawn based on the local room_name variable. On resume, room_name can be auto-scoped from the current cwd before the resume branch runs, which can diverge from the persisted room in $AIRC_WRITE_DIR/room_name (e.g., resuming a prior #general session from inside a repo). This can cause the sidecar to be spawned when it shouldn’t (double-joining #general) or skipped when it should run. Prefer checking the persisted room (read $AIRC_WRITE_DIR/room_name when present) or explicitly setting room_name from that file before calling the sidecar helper on the resume/join/host paths.
| [ "$room_name" = "general" ] && return 0 | |
| [ "$use_room" = "1" ] || return 0 | |
| local _primary_scope="$AIRC_WRITE_DIR" | |
| local _primary_scope="$AIRC_WRITE_DIR" | |
| local _effective_room="${room_name:-}" | |
| if [ -f "$_primary_scope/room_name" ]; then | |
| _effective_room=$(cat "$_primary_scope/room_name") | |
| fi | |
| [ "$_effective_room" = "general" ] && return 0 | |
| [ "$use_room" = "1" ] || return 0 |
…pe (#123) fix(send): honor --room <name> flag instead of letting it fall through to body Pre-fix: 'airc send --room general "lobby ping"' (or 'airc msg --room') was treated by the argparse as 'first positional = --room', then 'second positional = general', and the message body became literal '--room general lobby ping'. Silent mis-routing to the current scope's room. Caught by vhsm-Claude on 2026-04-26 dogfooding the #122 multi-room sidecar: 'BOTH --room general and --room cambriantech from your tab arrived at my monitor as literal text starting with --room <name> in [#useideem]. the flag is being treated as message body.' This is exactly the evidence-eating shape the project rejects: send returns 0, message LANDED, but in the wrong room. From the receiver's side it looks like a sender mistake; from the sender's side it looks like the substrate works. Neither knows the room got crossed. Fix: - Parse --room <name> at the top of cmd_send (before the @-or-not positional check). If --room names a sibling sidecar scope under the .airc.<name> convention, re-exec ourselves with AIRC_HOME pointing at that scope so the rest of the function runs there. - If --room names a room we're NOT subscribed to, die loudly with a list of rooms we ARE in. Never fall through silently. - Recursion guard via AIRC_SEND_REROUTED=1 prevents loops if a sibling scope is misconfigured (can happen mid-bounce when a sibling's room_name file is empty). - Determine project scope by stripping a trailing .<word> from the current AIRC_WRITE_DIR, so 'airc send --room general' from inside .airc.general/ correctly resolves the project scope as the source of truth for what rooms are subscribed. Test: scenario_send_room_flag — 8 assertions, all green: - --room <current>: no-op route (lands in current scope's log) - --room <sibling>: re-routes to sibling .general scope - No double-write to primary scope on re-route - --room <unsubscribed>: exits non-zero with structured stderr - stderr says 'not subscribed in this scope', lists subscribed rooms - --room <r> @peer DM also re-routes correctly Also updates README.md's auto-scope section to document the dual-room default (auto-scoped project + #general sidecar) introduced in #122, and explains the new send --room flag with examples. Platform: re-exec via 'env' is POSIX-standard. No platform-specific change. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
fix(part): IRC /part semantics — leave one room, keep sidecar alive Pre-fix: 'airc part' from a primary scope (e.g. #useideem) called cmd_teardown which (post-#122) cleaned BOTH the primary scope AND the #general sidecar — so leaving #useideem also dropped the lobby unintentionally. IRC convention: /part leaves ONE channel; the lobby should persist. Caught while testing the multi-room model after #122 landed. Two related issues fixed: 1. cmd_teardown's pgrep-children walker would catch the sidecar bash (forked from primary) and kill it via the descendant tree even though the sidecar's PID isn't in primary's airc.pid (after #122 we stopped appending it). Added AIRC_TEARDOWN_PART_ONLY=1 guard: when set, cmd_teardown's exclusion list reads sidecar's airc.pid + descendants and removes them from the kill set. 2. cmd_part now sets local AIRC_TEARDOWN_PART_ONLY=1 before calling cmd_teardown. This also short-circuits the explicit sidecar-block in cmd_teardown (gist + pidfile cleanup for the .general scope), so part is fully scope-local. Also: removed the redundant 'echo $sidecar_pid >> primary/airc.pid' from spawn_general_sidecar_if_wanted. The sidecar already has its own scope's airc.pid, and cmd_teardown's explicit sidecar-block walks that pidfile directly. Appending was unnecessary AND was exactly what made cmd_part nuke the sidecar via the primary's pidfile walk in pre-#122 testing. Test: scenario_part_keeps_sidecar — 6 assertions: - primary + sidecar both running pre-part - airc part removes primary's airc.pid - sidecar's main bash PID still alive after primary's part (the load-bearing assertion — was the regression) - sidecar scope dir + pidfile preserved - sidecar room_name preserved - subsequent 'airc teardown' (no flag) DOES reap the sidecar (verifies full-kill semantic still works for the explicit case) Test bugfix included: read first PID from sidecar's airc.pid via awk '{print \$1; exit}' instead of head -1. host-mode airc.pid is '\$\$ PAIR_PID hb_pid' on one line, so head -1 returned the whole line and kill -0 failed on the multi-PID string. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…143) chore(readme,skills): bring docs to spec for canary→main README updates: - Integration suite count: 88 assertions / 11 scenarios → ~245 / 32 - Core Commands: add `airc msg --room <name>` (sibling-room send) and `airc away` / `airc back` (IRC /away alias) - Default Rooms: document /part stickiness (parted_rooms persists in primary scope's config) and `airc join --general` re-opt-in flag - Skills table: add /whois, /away, /kick rows so the table covers every IRC verb in the IRC↔airc table (no more "documented in table, missing from skills") New skills (install.sh auto-symlinks; no installer changes): - skills/away/SKILL.md — IRC /away alias for status set/clear - skills/whois/SKILL.md — identity lookup + cross-scope walk note - skills/kick/SKILL.md — host-only peer eviction with SSH key drop Why now: vhsm and continuum drove the IRC-table audit through QA. README and skills were the last surfaces still claiming the pre-#122/#138/#139 shape. Closing the gap before promoting canary to main so the merged tree presents a coherent story.
Summary
Closes #121.
Bare
airc joinfrom a project repo now subscribes the tab to both the auto-scoped project room (#useideemfromuseideem/*,#cambriantechfromCambrianTech/*) and#general— simultaneously. This realizes the IRC mental model Joel called out: agents in their natural domain-specific room AND the lobby, so cross-project AI-to-AI coordination happens through the substrate without forcing tabs to leave their project context.How it works
Sidecar-scope architecture (Option B from the design discussion in #121):
$cwd/.airchosts/joins the project room as today.airc connect --room generalis forked withAIRC_HOME=$primary.general. Same visible nick (AIRC_NAMEpassed through), independentssh_key+ peer records.AIRC_GENERAL_SIDECAR=1(the spawned sidecar reads this at the top ofcmd_connectto skip its own sidecar).[#room]prefix —[#useideem] vhsm: hiand[#general] continuum-b741: hiinterleave through the same Monitor.cmd_teardownextended to clean both scopes (primary's gist + sidecar's gist + sidecar's pidfile).Flag semantics — split from prior alias
--room NAME--room-only NAME--no-general--no-roomAIRC_NO_GENERAL=1--no-generalThe old
--no-general/--no-roomalias is gone. Test harness + integration READMEs +/listskill rewritten to--no-roomfor legacy semantics; functionally equivalent to old behavior.Tests
scenario_general_sidecar_default— 12 assertions, all green:.generalscope dir created withroom_name=general, sidecar PID appended to primaryairc.pidand alive--no-general: no sidecar banner, no.generalscope--room-only NAME: hosts named room, no sidecarAll existing scenarios still pass (the global
AIRC_NO_GENERAL=1in the test harness keeps them sidecar-free).Test plan
bash test/integration.sh general_sidecar_default— 12/12bash test/integration.sh auto_scope— still 4/4 (regression check)bash test/integration.sh resume_prints_connected_banner— still 2/2airc joinfromuseideem/*repo lands in both#useideemand#general; events from both interleave through the MonitorOut of scope (future PRs)
airc msg --room NAMEfor cross-room broadcast from one tabairc dm @peerauto-resolving peer's current host across subscribed rooms🤖 Generated with Claude Code