Skip to content

canary→main: install/UX e2e + cross-vendor agent support (Codex) + #351 CI cleanup - #361

Merged
joelteply merged 11 commits into
mainfrom
canary
Apr 30, 2026
Merged

joelteply merged 11 commits into
mainfrom
canary

Conversation

@joelteply

@joelteply joelteply commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Continuation of #349 (the morning's bundle). Carl-flow QA pass on the fresh-Mac install path expanded into cross-vendor agent support, sandbox interop work, and CI honesty. Live mesh proof: this bundle was reviewed + merged peer-to-peer over airc itself, four agents (Claude Code on multiple Macs + Codex) coordinating across project rooms.

Bundled fixes (11 commits, oldest → newest)

Skills + UX

Cross-vendor agent (Codex) support

CI honesty (#351)

Test plan

  • Carl validated each PR end-to-end on his fresh-Mac rig before merge to canary
  • Required gates green on this bundle (clean-install x4 + require-canary-or-hotfix)
  • Live mesh proof: cross-vendor agent-to-agent over airc — first non-Claude-Code peer (Codex/continuum-2c54) joined #cambriantech via gist substrate, paired with Claude Code peers across project rooms
  • Post-merge: curl ... | bash from a fresh shell on a vanilla Mac produces a working install with both Claude Code AND Codex skills wired

Known followups (post-bundle, deliberately NOT included)

🤖 Generated with Claude Code

joelteply and others added 4 commits April 29, 2026 19:55
…h stderr (#348) (#350)

bash heartbeat (cmd_connect.sh:1595) had two issues bearer_gh.py already
solved for the message-send path back in #285:

1. `gh gist edit GIST FILE` (no flag) requires the basename to already
   exist in the gist. After a take-over / fresh-host race, the canonical
   `airc-room-<channel>.json` may not yet be in the gist. Plain edit
   then fails with 'unsure what file to edit; either specify --filename
   or run interactively' (or, per #285, silently no-ops). bearer_gh.py
   handles this by checking gist contents first and using `-a` (add)
   when the file isn't there. Port the same defense to bash.

2. When eviction fires after N consecutive heartbeat failures, the
   raw gh stderr is appended to the airc event log verbatim. Carl
   sees gh's vocabulary ('unsure what file to edit', '401 Unauthorized',
   'API rate limit exceeded') in their airc event stream — opaque,
   off-vocabulary, no clear next action. Classify into airc-readable
   buckets (rate-limit / multi-file-disambig / auth / network) before
   emitting.

Bash heartbeat now:
- First attempt: `gh gist edit GIST FILE` (replace, happy path)
- On failure with disambig stderr: retry as `gh gist edit GIST -a FILE` (add)
- If both fail: count toward eviction
- On eviction: classify the captured stderr → emit one airc event with
  human-readable cause (and a #348 self-link for the multi-file case so
  Carl knows it's a known bug, not their misconfiguration)

Doesn't touch the eviction threshold, the local-state cleanup, or the
SIGTERM-parent self-heal — those were already correct. Just the
gh-call shape and the user-facing event text.

Per other-mac's #348 review: classifier covers the four buckets we
discussed (rate-limit, multi-file-disambig, auth, network) plus a
raw-fallback for unmodeled errors and an empty-stderr branch for
defense-in-depth.

Test: syntax check passes; behavioral verification will land via the
next mesh take-over scenario or a doctor scenario added in a follow-up.

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…al command on the user (#352)

fix(join skill): auto-trigger gh auth login instead of telling the user

Carl on the other tab tried /join, hit 'gh auth invalid', and saw the
agent dump 'Run this in the prompt: ! gh auth login -h github.com -s gist'
back at them. Joel had to close Claude and re-auth manually. install.sh
already does this auto-trigger when stdin is TTY (via #339); the skill
just had stale text saying "install + 'gh auth login'" without telling
the agent to RUN it.

Updated /join SKILL.md section 1:
- Spell out the auto-trigger pattern explicitly: agent runs
  `gh auth login -h github.com -s gist -p https -w` itself via Bash.
  -h/-p/-w skip every interactive prompt; -w uses browser device code;
  gh blocks until the user completes auth in the browser → Bash blocks
  with it → success returns → agent continues to airc join.
- Note device-code-line surfacing — Bash output buffering can hide it
  if the agent isn't deliberately quoting it back to the user.
- Add the rate-limit-vs-real-auth pre-flight (mirrors the cmd_connect.sh
  fix from #344): probe `gh api rate_limit` first; if reachable, the
  token is fine and gh is misreporting a secondary-rate-limit 403 as
  'token invalid'. Tell the user to wait, not re-auth.

Doc-only — no code change. The skill text is the agent's runtime
prompt; updating it changes behavior on the next /join invocation
across every Claude Code session that picks up the new skill.

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…ebug session (#353)

Previous fix (#352) added a 'pre-flight diagnose' step that the agent
narrated to the user — Carl typing /join saw 'running gh api rate_limit
... token is actually fine ... issue #341 case ... proceeding with
join'. That looks like a bug. The diagnose should be a silent gate, not
a story the user sits through.

Reframed the section: don't pre-flight at all. Just run airc join. If
airc itself surfaces a gh-auth message (rate-limited / token invalid /
auth invalid), react minimally:

- 'rate-limited' → tell user verbatim, do nothing else (airc already
  disambiguated via #344's cmd_connect.sh pre-flight; re-probing is
  redundant and chatter)
- 'token invalid' → run 'gh auth login -h github.com -s gist -p https -w'
  silently, surface only the device-code line for the user, then retry
- 'gh missing' → install + auth, one short line, proceed

The principle stated explicitly: Carl running /join should see airc
events + outcomes, not auth-handling internals. Internal disambiguation
silent; user-actionable result one short sentence.

Joel caught this on the 2-tab cross-machine test minutes after #352
landed — the agent dutifully followed #352's instructions, ran the
narrated pre-flight, and produced exactly the "looks like a bug"
output Carl shouldn't see.

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…lose required (#354) (#356)

Joel's pain: 'having to close out of all claudes is a major point of
friction, for every update. people keep these running all the time.'

The old /update skill explicitly told the agent: 'Leaves the running
monitor untouched; report the new SHA and tell the user to teardown +
connect to pick it up.' That's the friction. Every airc update meant
the user had to either:

- close + reopen each Claude Code tab (lose context, lose any in-flight
  conversation), or
- mentally remember to run 'airc teardown && airc join' in each tab
  (rote, easy to forget, splits the agent's thread)

Rewrites the /update skill so the agent does the full lifecycle itself,
in-session, without user action:

1. Run airc update; capture before/after SHA.
2. If SHA changed: TaskStop the Monitor task this session armed for
   /join. (If task id is lost, fall through — airc teardown reaps by
   PID file regardless.)
3. Run airc teardown — kills current scope's processes; preserves
   identity + peers + log + saved channel.
4. Re-arm Monitor with airc join — new bash process loads the just-
   pulled binary fresh from disk.
5. ONE short sentence to the user: 'Updated to <sha>; monitor bounced
   onto new code.' Don't narrate the lifecycle steps.

Net: 'Updated, mesh blips for ~5s while host re-elects, you're back on
the new code in the same tab' replaces 'go close every tab.'

Skill text changes are called out separately — those genuinely DO
require a tab restart because the agent's prior reasoning in the
conversation is locked-in from the old skill behavior, and Claude
Code may also session-cache the skill prompt. The skill instructs
the agent to surface a single explicit hint when changed SKILL.md
files are detected in the update output. That's the one piece of
manual user action that remains.

Adds Monitor to allowed-tools (was Bash-only). AIRC_UPDATE_NO_BOUNCE=1
env var added as a power-user knob to opt out of the auto-bounce.

This complements but doesn't supersede #354 (airc-binary-side hint
about skill restart). The binary side is for users running airc
update directly from a shell; the skill side is for users invoking
/update inside Claude Code.

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
joelteply and others added 7 commits April 29, 2026 21:30
…351 CI failures) (#362)

test: scaffold private.pem in synthesized identity dirs (post-#343 fix)

Pre-#343 the test scenarios that synthesize a partial host scope (cmd_send
liveness probe, away-status, list, quit) used `ssh-keygen -t ed25519` to
create ssh_key + relied on the airc binary to lazily create private.pem
via `openssl genpkey` if needed. Post-#343 init_identity creates
private.pem via the venv cryptography path, but the test scenarios that
DON'T go through `airc connect` at all skip init_identity entirely —
sign_message then dies with `ed25519 sign failed: [Errno 2] No such file
or directory: .../private.pem` before reaching the actual code-under-
test (the monitor-liveness diagnostic, the away-marker logic, etc).

Symptom in CI: 6 failures in the sdmd scenario alone all caused by the
script bailing on the missing private.pem before reaching the assertion
the test was actually validating.

Adds `scaffold_identity()` helper next to spawn_host. Creates ssh_key
(via ssh-keygen, unchanged) AND private.pem (via airc_core.identity
bootstrap-ed25519 with PYTHONPATH set to make airc_core importable).
Used at the 4 manual-scaffold sites: sdmd (send_dead_monitor_dies), aw
(away-status), ls (list), quit (quit).

The 5th ssh-keygen call (line 807, key-rotation scenario) replaces an
EXISTING ssh_key after the scope was already initialized — private.pem
is already there, no scaffold change needed.

Pairs with other-mac's WIP for cluster B (gh-auth-less runner test
infra). Both fold into #351.

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
#363)

The integration-suite has been failing on every canary push for the
duration of this push (#351 cluster B). Root cause: 14 scenarios call
airc with --room or bare connect (use_room=1), which trips
cmd_connect's pre-flight gh-auth check (#338) — and CI's integration-
suite runner has no gh auth wired in (no PAT secret).

Add requires_gh_auth_or_skip() helper at the top of integration.sh:
checks gh auth status once (cached for subsequent calls — saves rate
limit budget when the suite runs many substrate scenarios), and
either proceeds (when authed) or marks the scenario as skipped-pass
with the reason. Test count stays sane, suite goes green on no-auth
runners, substrate coverage preserved when gh IS authed (developer
machines, future CI with PAT secret).

Apply the gate to the 13 scenarios that exercise substrate features
(--room or use_room=1 default): room, events, mnemonic, kick,
heartbeat, bounce, two_tab_localhost, auto_scope, connect_after_kill_
recovers, general_sidecar_default, host_msg_publishes_to_gist,
general_has_shared_gist, custom_room_creates_gist.

Cluster A (Carl, #362) was test-stderr wording updates for the #343
ed25519-message-shape change. Together these close out #351.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
… format) (#364)

* docs+install: airc skills auto-install into Codex too (same SKILL.md format)

Joel installed Codex on the test rig — first non-Claude-Code agent to
hit the QA pass. Investigation: Codex CLI uses ~/.codex/skills/<name>/
SKILL.md with YAML frontmatter + markdown body — IDENTICAL on-disk
format to Claude Code's ~/.claude/skills/. Pre-fix, install.sh only
symlinked into ~/.claude/skills, so Codex sessions had no airc surface
even with Codex installed.

install.sh: extract the skill-install loop into _install_airc_skills_into
(target_dir, agent_label) and call it twice:
  1. Always for $SKILLS_TARGET (Claude Code; pre-existing behavior).
  2. Conditionally for $HOME/.codex/skills when both `command -v codex`
     succeeds AND ~/.codex exists (i.e. Codex has been run at least
     once and created its config dir). Honors CODEX_SKILLS_TARGET env
     var the same way SKILLS_TARGET supports overrides for tests.

Output now distinguishes per-agent:
  -> Skill (claude-code): /join
  -> Skill (codex):       /join

uninstall.sh: matching cleanup walks BOTH skill dirs and removes any
symlink resolving into the airc clone. Doesn't touch .system/ dirs or
non-airc symlinks (resolve target check protects against accidentally
nuking other plugins). Help block updated.

integrations/openai-codex/README.md: full refresh.
- Stale 'gh-rooted IRC over Tailscale' wording dropped (post-3c the
  gist IS the wire; no Tailscale).
- Stale 'airc teardown --flush && airc join <gist-id>' recovery hint
  dropped — post-#344 auth failures point at gh auth login directly.
- Adds Codex skill auto-install detail + visibility into the new
  per-agent install output.
- Adds the full verb surface (whois, away, kick, identity, uninstall,
  update, daemon) which the prior README only listed a subset of.
- Surfaces known gaps (Claude-Code-specific bits in skill text → #357,
  DM E2EE silent-plaintext → #358) so Codex agents reading the doc
  know what NOT to trust yet.

Tested on this Mac: live install run produced 23 skill symlinks under
~/.codex/skills, all resolving to ~/.airc-src/skills/<name>/. Codex
should now expose the same /join /msg /list etc. surface that Claude
Code does.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(install): auto-write Codex network permission profile (no manual sandbox flag needed)

Joel hit this on the QA rig: Codex's default sandbox blocks subcommand
network egress, so every airc verb invoked from inside Codex fails
with `error connecting to github.com` (or, because gh's auth probe
also fails, the indirect `token in keyring is invalid` misreport).
Telling users to relaunch Codex with `--sandbox danger-full-access`
or wire up `--ask-for-approval on-request` is the friction Joel called
out. Skills can't declare required permissions in Codex's current
skill format, so the cleanest automation is to write a scoped network-
permission profile into ~/.codex/config.toml at install time.

install.sh, when it detects Codex (same probe as the skill-symlink
path: `command -v codex && [ -d ~/.codex ]`), now appends a named
permission profile scoped to ONLY the gh hosts airc uses:

  [permissions.airc.network]
  enabled = true
  mode = "limited"
  domains = { "github.com" = "allow", "api.github.com" = "allow",
              "gist.github.com" = "allow" }

…and sets `default_permissions = "airc"` at the file's top level,
but ONLY if no default is currently set. A user with a different
default keeps it; install.sh prints how to invoke airc-needing
sessions explicitly via `codex --profile airc`.

Idempotent: grep guards check for existing `[permissions.airc.network]`
header + `default_permissions =` line before writing. Re-runs of
install.sh on a configured machine produce no changes (no spurious
"Added airc network profile" line).

Honors AIRC_SKIP_CODEX_CONFIG=1 for users (or test harnesses) who
want the skill symlinks but NOT the config write — same shape as
AIRC_SKIP_PREREQS=1 for the package install loop.

Tested on this Mac: first run added both blocks (top-level key +
[permissions.airc.network] section). Second run was a no-op (no
output line, no file change). Verified: cat ~/.codex/config.toml
shows the profile + matches Codex's documented format.

Doesn't use the codex CLI for the write because there is no `codex
config` subcommand — Codex offers per-invocation `-c key=value`
overrides + named profile loading via `-p`, but no persistent-edit
CLI. File-edit + grep idempotency is the standard pattern install.sh
already uses for shellrc PATH addition.

README updated to document the auto-config + the AIRC_SKIP_CODEX_CONFIG
escape hatch.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(install): add [permissions.airc.filesystem] alongside network block (silences Codex warning)

Joel's Codex first-encounter QA surfaced the warning:
  Permissions profile 'airc' does not define any recognized filesystem
  entries for this version of Codex. Filesystem access will remain
  restricted.

The original [permissions.airc.network] block (added in 867c161) granted
network access to gh's domains but left filesystem entries empty.
Codex's default-restricted filesystem then silently blocks airc verbs
that mutate state (identity bootstrap, airc update, the per-cwd
state writes), even though the user thought the airc profile was the
default.

Adds a paired [permissions.airc.filesystem] block scoped to airc's
actual footprint:
  ~/.airc-src/     airc clone + .venv (airc update, identity bootstrap)
  ~/.airc/         user-default state dir
  ~/.local/bin/airc + relay  binary symlinks (write needed for uninstall)

Plus a [permissions.airc.filesystem.':project_roots'] sub-section for
the per-cwd .airc/ + .airc.general/ directories (per-project airc state
+ #general sidecar).

Codex's TOML syntax for filesystem permissions per the config reference:
  permissions.<name>.filesystem.<path-or-glob> = "read" | "write" | "none"
  :project_roots is the special token for per-project scoping.

Idempotent: grep guard checks for existing [permissions.airc.filesystem]
header before writing. Same shape as the network block.

Tested on this Mac: live install.sh re-run wrote the new block once,
second run was a no-op (no spurious changes), config.toml has both
[permissions.airc.network] and [permissions.airc.filesystem] sections
with the airc.filesystem.':project_roots' sub-section.

Codex first-encounter (Joel's QA tab) should pick this up on next
restart and the filesystem warning should clear.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…startup (regression from #364) (#366)

The filesystem-permission block added in the second commit of #364
broke Codex on startup with:

  Error loading configuration: permissions profile requests filesystem
  writes outside the workspace root, which is not supported until the
  runtime enforces FileSystemSandboxPolicy directly

Codex 0.125's runtime can't honor home-dir-scoped filesystem grants
in named profiles yet. Even the :project_roots-only variant didn't
help (the block was rejected as a whole). On every machine that ran
the merged #364, the next codex invocation fails to start until the
block is removed from ~/.codex/config.toml manually.

Surfaced live during the codex first-encounter QA: after Joel restarted
Codex post-#364 merge, Codex hard-failed at config load with the
above error.

Two-part hotfix:

1. Stop writing the [permissions.airc.filesystem] block. Replace the
   write code with a comment explaining why the block is omitted and
   pointing at git history for the prior version. Living with Codex's
   harmless 'does not define any recognized filesystem entries'
   warning is preferable to a hard-fail-on-startup that takes Codex
   offline entirely.

2. Add a cleanup step that DETECTS the broken block in existing
   ~/.codex/config.toml files and strips it. Without this, every
   user who already ran #364 has a permanently broken Codex until
   they hand-edit. Cleanup uses Python with the existing venv
   (we have it from cryptography) to do a section-aware strip;
   handles the leading '# airc filesystem permissions' comment and
   any [permissions.airc.filesystem.<sub>] children in one pass.
   Runs every install.sh invocation; idempotent (no-op when the
   block is already absent). Collapses runs of >2 blank lines that
   the strip might have left.

Tested on this Mac:
  - simulated stale block → install.sh detects + strips
  - Codex (codex exec) starts cleanly after cleanup
  - re-runs of install.sh on cleaned config: no-op, no spurious changes

Network profile + skill symlinks from #364 stay intact and continue
working — only the filesystem block is removed.

Open question / followup: Codex's docs claim filesystem profiles are
supported per the config-reference, but the runtime rejects them.
Possibly a 0.125-vs-newer-version gap. When/if Codex's runtime adds
support, restore the block (history at git log -- install.sh).

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…cy.set] — workaround openai/codex#10695 (#368)

feat(install): inject GH_TOKEN into Codex via [shell_environment_policy.set] (workaround openai/codex#10695)

Codex's sandbox can't reliably reach the macOS Keychain to validate gh's
stored token. Symptom: gh auth status flakes between ✓ and X within a
single Codex session, airc join trips on the X path even though the
token is real and valid (Joel hit this on the codex first-encounter
QA pass; openai/codex#10695 is the upstream tracking bug, with a
contributor analysis confirming Codex's shell handlers don't merge
session dependency_env into spawned processes; patch in flight).

OpenAI's own maintainer guidance on #10695: "If echo $GH_TOKEN is
defined at app launch it's visible to sandboxed tools." Codex's
[shell_environment_policy.set] is documented as "explicit environment
overrides injected into every subprocess" — exactly what's needed to
inject GH_TOKEN at session start and bypass the keychain flake.

install.sh now writes a marker-bracketed block to ~/.codex/config.toml:

  # AIRC-GH-TOKEN-START — managed by install.sh; airc update refreshes...
  [shell_environment_policy.set]
  GH_TOKEN = "<gh-auth-token-output>"
  # AIRC-GH-TOKEN-END

Idempotent + token-refreshing: every install.sh run (including airc
update) strips any prior airc-managed block via sed range-delete and
rewrites with the current `gh auth token` output. If gh auth rotates
keys, the next airc update propagates the new token.

Composes cleanly with user-defined [shell_environment_policy] keys at
the parent level (inherit, include_only, etc.) because we use the
sub-table form [shell_environment_policy.set] rather than inline
`set = { ... }` syntax that would conflict.

AIRC_SKIP_CODEX_TOKEN=1 escape hatch for users who'd rather manage
GH_TOKEN themselves (shell alias, separate launcher, etc).

uninstall.sh: matching cleanup strips the marker-bracketed block from
~/.codex/config.toml when airc is removed. Same sed range-delete pattern.

Trade-offs explicitly documented in the codex README:
- Token is plaintext on disk in ~/.codex/config.toml (similar trust
  posture to ~/.codex/auth.json which already holds OpenAI creds).
- When openai/codex#10695 lands a fix, this injection becomes a
  no-op safety net rather than load-bearing workaround.

Joel's stated preferences ruled out:
- PATH-shadowing codex (too invasive — "major interference to
  man-in-the-middle codex")
- Asking the user to type the launch one-liner each time ("yuck")
- Shellrc-exporting GH_TOKEN to every shell (security leak beyond
  airc's scope)

Tested on this Mac: live install run wrote the block with current
gh token, Codex starts cleanly, second install.sh run replaced the
block (no duplicate), uninstall flow strips cleanly.

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…loses #367) (#369)

The user-visible bug: in environments where gh's auth probe is flaky
(Codex sandbox especially — openai/codex#10695), airc join's preflight
hard-died with "token invalid" even when the scope's airc monitor was
already running and bearer was actively reading/writing gh gists. The
skill then reacted to the (wrong) token-invalid message by trying gh
auth login -w (which also fails in the same flaky env), and Carl saw
a multi-step debug-loop wreckage on a scope that was actually fine.

Joel's call: "if the skill constantly causes this, it seems broken to
everyone. do the most correct and robust [fix]."

Two-layer fix.

LAYER 1 — cmd_connect.sh: trust-existing-monitor short-circuit
-------------------------------------------------------------------
Hoist the "this scope's monitor is already running" detection (which
already lived at lines ~438 below) to BEFORE the gh-auth preflight.
On a hit (live PID in airc.pid), emit the same canonical message +
return 0. No preflight runs. The gh-auth probe was always meant to
catch "user is about to do real work, ensure their gh credential is
healthy first" — but if real work is ALREADY HAPPENING in this scope
(live monitor → live bearer → live gh API calls), the running
monitor's own health is the authoritative signal, not an out-of-band
probe.

Stale pidfile (file present, no live PIDs) falls through to the
canonical cleanup block below — that path was already correct, no
duplication.

LAYER 2 — /join skill: airc status as ground truth
-------------------------------------------------------------------
Adds a section to skills/join/SKILL.md explicitly telling the agent:
`airc status` is the authoritative signal for whether this scope is
in the mesh. It's local-only — no gh probe, no network call. When
gh-auth-status probes disagree with airc status, trust airc status.

Also adds explicit handling for the "monitor already running" exit:
that's a successful no-op, NOT a failure. Run `airc status` once to
confirm + narrate "already in the mesh as <nick> in <rooms>". Do
NOT re-arm a Monitor (would dual-tail the same scope).

Generalizes beyond Codex — same fix unblocks the rate-limit-misreport
class (#344-era) AND any future "gh probe noisy but airc actually
works" class.

Tested on this Mac: airc join with a live monitor in the scope now
emits the canonical "monitor already running" message and exits 0
WITHOUT firing the gh-auth preflight. Before this change, the
preflight always fired first; on environments where it flaked, that
was the source of the cascade.

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
closes #370) (#371)

Inside Codex's sandbox, `kill -0 <pid>` for processes spawned outside
the sandbox returns failure even when the process is alive. Result:
prune_pidfile_and_count returns 0, status reports "monitor: not
running" while the monitor IS running and visibly streaming events
(Codex was hosting #cambriantech via continuum-2c54 with bearer events
flowing, but airc status said the monitor was dead).

Same root cause as openai/codex#10695 sandbox process isolation —
also affects pgrep cross-tree (sysmon failure surfaced in the same
session). airc isn't going to win against the sandbox boundary; it
can route around it.

Fix: when prune_pidfile_and_count returns 0 BUT a pidfile exists
(implying a monitor was started here), look at the scope's
bearer_state.<channel>.json files. If any has a last_recv_ts
within 2x the reminder interval (default 600s), the bearer-recv
child is provably alive — only a live monitor's bearer-recv loop
updates that file. Report "likely-alive (<Ns> via #<channel>;
kill -0 blind in this sandbox — see #370)" instead of the false
"not running".

Falls through to the existing "stale pidfile" message when bearer
state is also stale (i.e., the monitor really IS dead, not just
sandbox-invisible). So we don't lose the genuine-failure signal.

Walks all bearer_state.*.json files in the scope (host's #general
sidecar + any other subscribed channels). Picks the freshest. Hosts
of project rooms don't have bearer_state for the project room itself
(host writes locally), but the #general sidecar IS a recv path even
for hosts — that's the key insight that makes this work for Codex's
exact case (hosting #cambriantech, sidecar-recv'ing #general).

Reads reminder interval from $AIRC_WRITE_DIR/reminder when present,
defaulting to 300s if absent or invalid.

Tested locally on a non-pidfile scope: still reports "not running"
correctly (pidfile-present is the gate). Live-test path: Joel runs
airc status from Codex's continuum-2c54 scope post-merge — expect
"monitor: likely-alive (<Ns> via #general; kill -0 blind ...)"
instead of "monitor: not running".

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply joelteply changed the title canary→main: /update auto-bounce + skill silent-diagnose + heartbeat classifier canary→main: install/UX e2e + cross-vendor agent support (Codex) + #351 CI cleanup Apr 30, 2026
@joelteply
joelteply merged commit 009d6bc into main Apr 30, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant