Repository navigation
Conversation
Codex/non-Monitor runtime ergonomic. With the env var set, after a successful airc msg the cmd_inbox path runs quietly (matching codex-poll defaults: AIRC_INBOX_QUIET_EMPTY=1 AIRC_INBOX_EXCLUDE_SELF=1) so the runtime sees inbound peer responses inline instead of waiting for the next user-prompt-submit hook fire (which only happens when the user types a new prompt). Why this matters: under the Monitor-driven flow (Claude Code), inbound streams continuously into the agent's context. Under Codex-style non-Monitor runtimes, the agent can only see new airc traffic when the user-prompt-submit hook runs, which is gated on user input. After Codex sends a message via airc msg and waits for a peer reply, the reply sits unseen until the user types something — silent latency that makes airc feel broken from inside Codex sessions. Wiring is opt-in (env-gated, default off) so Monitor flows are unchanged and the new behavior never accidentally fires for users who don't want it. cmd_codex_start exports AIRC_SEND_TRIGGERS_POLL=1 by default for processes it spawns, so any Codex session bootstrapped via codex-start gets the auto-poll without manual env config. Honors caller override (AIRC_SEND_TRIGGERS_POLL=0) for opt-out. The post-send poll is positioned at the success-path tail (after the user-facing footer, before the closing brace) so it only fires when delivery actually succeeded — not on monitor-down failure, not on queueing, not on auth failure. --internal callers (cmd_rename's propagation, etc.) stay silent since they're machine-to-machine traffic, not Codex's user-visible send surface. Regression test (scenario_send_triggers_poll, 5 assertions): - cmd_send.sh references AIRC_SEND_TRIGGERS_POLL (wiring present) - gate is on '=1' (opt-in only, not 'set to anything') - cmd_codex_start exports the env var (auto-opt-in for codex children) - codex-poll surfaces unread peer message (the call cmd_send wires) - post-send poll does NOT fire on send-failure path (gate placement) Existing tests still green: scenario_inbox (8/0), send_dead_monitor_dies (14/0), test_codex_hook.py (6/6), test_inbox.py (3/3). Live-validated by sibling Codex agent who patched the path locally and sent this very class of message through the patched send (their inbox update fired correctly). Closes the latency gap reported in cmd_send for Codex/non-Monitor runtime consumers.
|
Closing in favor of #556 (sibling Codex shipped same task ~2min earlier with additional fixes I missed: stale-backlog window bound + empty-poll exit status, both caught in live use; plus python tests on inbox.py changes). Unique value from this PR worth porting to #556: cmd_codex_start exports AIRC_SEND_TRIGGERS_POLL=1 by default for processes it spawns (lib/airc_bash/cmd_status.sh) — this gives codex sessions auto-opt-in to the new behavior without requiring manual env config or per-callsite flag. Caller can override (=0) to opt out. Suggesting as small followup to #556. |
There was a problem hiding this comment.
Pull request overview
Adds an opt-in post-send inbox poll intended to improve Codex/non-Monitor ergonomics by surfacing unread peer messages immediately after airc msg.
Changes:
- Adds
AIRC_SEND_TRIGGERS_POLL=1handling incmd_send. - Exports the env var during Codex detached start.
- Adds an integration scenario for the new wiring.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
lib/airc_bash/cmd_send.sh |
Adds env-gated post-send cmd_inbox polling. |
lib/airc_bash/cmd_status.sh |
Attempts to enable the env gate for Codex-started flows. |
test/integration.sh |
Adds and wires a new send_triggers_poll scenario. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # processes it spawns. --internal callers (rename propagation, etc.) | ||
| # stay silent — they're internal traffic, not Codex's user-visible | ||
| # send surface. | ||
| if [ "$internal" != "1" ] && [ "${AIRC_SEND_TRIGGERS_POLL:-0}" = "1" ]; then |
| # Codex/non-Monitor runtime ergonomics: any subsequent `airc msg` from | ||
| # this scope auto-fires cmd_inbox post-send so peer responses surface | ||
| # inline instead of waiting for separate user traffic. Honors the | ||
| # caller's existing setting (allow override to 0 for opt-out). | ||
| export AIRC_SEND_TRIGGERS_POLL="${AIRC_SEND_TRIGGERS_POLL:-1}" |
| # ── Behavioral: codex-poll itself surfaces the unread peer message. | ||
| # cmd_send.sh's post-send wiring invokes the same code path, with the | ||
| # same env defaults (AIRC_INBOX_QUIET_EMPTY=1 AIRC_INBOX_EXCLUDE_SELF=1). | ||
| # Proving codex-poll surfaces the message proves the call cmd_send | ||
| # wires actually does what cmd_send needs. | ||
| local out | ||
| out=$(AIRC_HOME="$home" "$AIRC" codex-poll 2>&1) | ||
| printf '%s' "$out" | grep -q 'unread-before-send' \ | ||
| && pass "codex-poll surfaces unread peer message (the call cmd_send wires for codex runtime)" \ | ||
| || fail "codex-poll did not surface unread peer message (got: $out)" |
Summary
Codex/non-Monitor runtime ergonomic. With `AIRC_SEND_TRIGGERS_POLL=1`, after a successful `airc msg` the `cmd_inbox` path runs quietly (matching codex-poll defaults: `AIRC_INBOX_QUIET_EMPTY=1 AIRC_INBOX_EXCLUDE_SELF=1`) so the runtime sees inbound peer responses inline instead of waiting for the next user-prompt-submit hook fire.
Why it matters: under Monitor (Claude Code), inbound streams continuously. Under Codex non-Monitor, the user-prompt-submit hook only fires on user input — so after Codex sends and waits for a peer reply, the reply sits unseen until the user types something. Silent latency that makes airc feel broken from inside Codex.
Wiring
Test plan
New scenario `send_triggers_poll` (5 assertions):
Existing tests still green:
Live-validated by sibling Codex agent who patched the path locally and sent the validation message through the patched send (their inbox update fired correctly during the dogfood test).
Files
🤖 Generated with Claude Code