Repository navigation
feat(channels): drop sidecar + cmd_send re-exec — Phase 2B.3 - #227
Conversation
…se 2B.3
Final piece of the Phase 2 sidecar→channels-as-metadata migration.
Net -120 lines across airc + cmd_send + the integration scenario it
unblocked.
## What changes
airc top-level (spawn_general_sidecar_if_wanted):
Body collapses from 84 lines (background process spawn, recursion-
guard env vars, --no-gist propagation, sidecar pidfile management)
to 7 lines: just call `airc_core.config subscribe --channel general`.
With Phase 1's mesh-singleton (one host per gh account), a separate
airc connect process for #general would discover the SAME mesh and
yield to the SAME host — pure overhead. The lobby is now just
another subscribed channel on the single scope.
Function name + callsites unchanged so cmd_connect's flow doesn't
need rewiring; only the body changed. Honors `parted_rooms` and
--no-general the same as before.
cmd_send.sh:
Drops the `--room`-triggered AIRC_HOME re-exec into sibling
`.airc.<roomname>` scopes. With one mesh host, all channels share
the same wire — `--room foo` becomes equivalent to `--channel foo`
(already added in 2B.1). Just stamp the envelope; no scope switch.
Removes 49 lines of sibling-scope resolution (project-scope
detection, room_name file reads, target-scope existence checks,
AIRC_SEND_REROUTED recursion guard).
test/integration.sh::scenario_general_sidecar_default:
Rewrote to verify the NEW behavior:
- subscribed_channels in primary's config.json includes "general"
- .general sibling scope dir does NOT exist
- --no-general suppresses the subscription
- --room-only is equivalent to --room + --no-general
Drops the "sidecar bash PID alive" assertion since there is no
sidecar process anymore.
## Verification
test/integration.sh tabs: 19/0 ✓
test/integration.sh room: 14/0 ✓
test/integration.sh queue: 7/0 ✓
test/integration.sh general_sidecar_default: 10/0 ✓
## What's left
Optional Phase 2C (deferred — not blocking):
- Joiner subscription propagation to mesh gist channels[] (today
the host advertises whatever channels it subscribed to at create;
joiners' additional channels are local-only).
- Per-channel monitor display filtering (today display shows ALL
channels with [#name] prefix; user can filter externally).
- Legacy room_name file deletion (back-compat for users on Phase
1/2A only; harmless to leave).
## Bug follow-ups (from e2e on canary, filed separately)
- #224 active-host-evicted (heartbeat hammers deleted gist forever)
— addressed in next PR
- Joiner-tails-full-history dump — own small PR
- argv --help intercept (msg/kick/etc) — own small PR
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Removes the multi-scope #general sidecar process model and aligns channel targeting behavior with the mesh-singleton design (single host/wire per GH account), so multi-room presence is represented via subscribed_channels rather than separate .general scopes.
Changes:
- Collapse
spawn_general_sidecar_if_wantedinto a config-levelsubscribed_channels += ["general"]update (no separate process/scope). - Delete
cmd_send --roomsibling-scope re-exec behavior; treat--roomas an alias for--channel. - Update the
general_sidecar_defaultintegration scenario to assert “no.generalscope” and validatesubscribed_channels.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
test/integration.sh |
Updates general_sidecar_default scenario to validate subscribed_channels and absence of a .general sidecar scope. |
lib/airc_bash/cmd_send.sh |
Simplifies --room behavior to stamp the envelope channel (no scope re-exec). |
airc |
Replaces sidecar spawning with a subscribed_channels subscription to general. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # 1. Default behavior: bare `airc join` adds "general" to | ||
| # subscribed_channels (no separate scope/process). | ||
| # 2. --no-general flag: project-only, no general subscription. | ||
| # 3. --room-only is equivalent to --room + --no-general. |
There was a problem hiding this comment.
This scenario is updated to assert that no .general sidecar scope/process exists, but the integration suite still runs several sidecar-dependent scenarios (e.g., send_room_flag / peers_cross_scope / whois_cross_scope / part_keeps_sidecar / part_persists) under the all) selector. With Phase 2B.3 semantics, those scenarios will now fail or become meaningless; they should be rewritten to use subscribed_channels (single-scope) or removed/disabled from the default run set.
| # Phase 2B.3: --room becomes equivalent to --channel. The pre-mesh | ||
| # sidecar model required re-exec'ing into a sibling scope because | ||
| # each room had its OWN host process; in the post-mesh world there | ||
| # is ONE host per gh account, so all channels share the same wire. | ||
| # Just stamp the channel field and continue. |
There was a problem hiding this comment.
--room is now treated as an alias for --channel, but there are still repo consumers/tests/docs that expect the old sibling-scope re-exec behavior (notably the integration scenario scenario_send_room_flag, which asserts writes land in a .general scope and that unknown rooms error). Update or remove those tests/docs, and consider printing a deprecation hint in the --room path so users discover --channel as the new spelling.
| # Phase 2B.3: the sidecar process is GONE. With Phase 1's mesh-singleton | ||
| # substrate (one gist + one host per gh account), a separate `airc | ||
| # connect` process for #general would discover the same mesh and yield | ||
| # to the same host — pure overhead. Instead we just add "general" to | ||
| # this scope's subscribed_channels list. cmd_send default-channel logic |
There was a problem hiding this comment.
The body of spawn_general_sidecar_if_wanted no longer spawns a sidecar, but the large header comment immediately above still describes sidecar scopes, separate wires, and PID-file behavior. Please update/remove that stale comment block so future readers don't assume .general scope creation or teardown behavior still exists.
…239) fix(2B.3): cmd_peers + cmd_whois stop walking sidecar scopes (resurfaced ghosts) Found by airc-96dd/authenticator-fd63 2026-04-28: post-Phase-2B.3 the .airc.<word> sidecar dirs aren't created or maintained, but cmd_peers + cmd_whois still walked them. A stale tr.json from /tmp/airc-trace2 (April 27 integration test) surfaced in airc peers of the live mesh as a ghost peer. ## Fix cmd_rooms.sh::cmd_peers — only walks primary scope. The sibling- sidecar aggregation made sense in pre-2B.3 (multi-room presence fragmented across scopes); post-2B.3 every peer is in primary's peers/, multi-channel context comes from the envelope's channel field + subscribed_channels config. cmd_identity.sh::cmd_whois — same fix. Cross-mesh peer resolution (asking the host for a peer record we don't have locally) is the real Phase 2C+ replacement; tracked as the wart ideem-local-4bef + continuum-b741 raised. For now, indirect peers return "no record" which is at least honest. ## Tests Deleted scenario_peers_cross_scope and scenario_whois_cross_scope — both exercised the removed sibling-walk. Same shape as the rewrite of scenario_general_sidecar_default in PR #227. ## Verification test/integration.sh tabs: 19/0 ✓ test/integration.sh whois: 5/0 ✓ test/integration.sh general_sidecar_default: 10/0 ✓ Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…ersists scenarios (#259) * fix(ci): restore 'all)' case in integration.sh dispatch (#244 / CI failure) #239 deleted scenario_peers_cross_scope and scenario_whois_cross_scope because those tests exercised the pre-Phase-2B.3 sidecar peer-walk that was removed. The Python regex used to scrub them — `if 'X' not in line` — was too aggressive: it matched the whole `all)` case line which contained both scenario names in its scenarios-to-run list. Result: `all)` deleted entirely. CI's no-arg invocation `bash test/integration.sh` then hit `*)` → exit 2 → push-to-canary integration job failed. ## Fix Restore an `""|all)` case (matches both no-arg and explicit `all`) with the proper scenario list MINUS the two deleted ones. Preserve the `*)` usage block as the unrecognized-scenario fallback. Verification: tabs 19/0; manual no-arg + 'all' invocation kicks off the full sweep instead of bailing. Closes the canary push integration-suite failure on 75e7bb5. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(ci): delete pre-2B.3 send_room_flag + part_keeps_sidecar + part_persists scenarios Same root cause as the cross_scope deletions in #239: these three scenarios test sibling-scope semantics that Phase 2B.3 (#227) deleted. Running them on canary HEAD fails because: - send_room_flag: expects --room to re-exec into .airc.<name> sibling scope. Post-#227, --room is a channel-tag alias for --channel; no scope switch. - part_keeps_sidecar: expects a separate sidecar process for #general. Post-#227, no sidecar process exists; #general is a subscribed_channel in the same scope. - part_persists: same. The 'sidecar' it tries to part isn't there. Coverage of the new behavior: - Channel-tag stamping: tabs / queue / status scenarios verify envelope.channel - subscribed_channels filter display: monitor_formatter + #243 path - general_sidecar_default: rewritten in #227 to verify subscribed_channels includes 'general' AND no .general dir is created. Verification: tabs 19/0; general_sidecar_default 10/0; away 5/0; no syntax errors. --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Final 2B piece. Sidecar process collapses to a single subscribe-to-general call; cmd_send --room re-exec deleted (with mesh singleton, all channels share one wire). Net -120 lines.
Verification: tabs 19/0, room 14/0, queue 7/0, general_sidecar_default rewrite 10/0.