Skip to content

Add Codex detached start adapter - #520

Merged
joelteply merged 1 commit into
canaryfrom
codex/detached-start-adapter
May 5, 2026
Merged

joelteply merged 1 commit into
canaryfrom
codex/detached-start-adapter

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

Codex shell tool calls can reap plain nohup airc join & children when the tool call exits. That made the Codex /join skill report a briefly healthy owner, then leave a stale pidfile and make airc msg refuse delivery.

This adds airc codex-start, backed by airc_core.codex_start, which launches airc join with start_new_session=True and forced AIRC_HOME. The Codex-facing skills now call that adapter instead of raw nohup. This is not the login daemon/autostart path; it is a session-scope Codex runtime adapter.

Validation

  • bash -n airc lib/airc_bash/cmd_status.sh lib/airc_bash/cmd_connect.sh lib/airc_bash/cmd_send.sh lib/airc_bash/cmd_teardown.sh test/integration.sh
  • git diff --check
  • python3 test/test_codex_start.py
  • python3 test/test_codex_hook.py
  • ./airc doctor --tests python_units -> 14 passed, 0 failed
  • Live continuum-scope validation: airc codex-start survived after the tool call exited, status reached transport health: ok (2 channel(s) fresh), and airc msg --channel general ... delivered.

Copilot AI review requested due to automatic review settings May 5, 2026 06:40
@joelteply
joelteply merged commit 989e227 into canary May 5, 2026
8 checks passed
@joelteply
joelteply deleted the codex/detached-start-adapter branch May 5, 2026 06:41

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

Adds a Codex-specific detached-start path for AIRC so Codex shell tool exits do not reap the background airc join owner. This fits the Codex integration layer by replacing ad-hoc nohup snippets with a dedicated adapter command.

Changes:

  • Add airc codex-start and the backing Python launcher module airc_core.codex_start.
  • Update Codex-facing skills and README guidance to use airc codex-start instead of raw nohup airc join &.
  • Add a unit test covering the Python detached-launch helper.

Reviewed changes

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

Show a summary per file
File Description
test/test_codex_start.py Adds a unit test for the new detached-start helper's subprocess invocation.
skills/update/SKILL.md Replaces manual Codex restart snippet with airc codex-start.
skills/resume/SKILL.md Switches Codex resume instructions to airc codex-start.
skills/repair/SKILL.md Switches Codex repair instructions to airc codex-start "$INVITE".
skills/join/SKILL.md Updates Codex join guidance to use the new adapter command.
skills/canary/SKILL.md Uses airc codex-start in the Codex canary bounce flow.
README.md Documents the new Codex start adapter at a high level.
lib/airc_core/codex_start.py Implements the detached subprocess launcher for airc join.
lib/airc_bash/cmd_status.sh Adds the cmd_codex_start shell entrypoint and post-launch status/inbox output.
airc Wires codex-start into top-level command dispatch.

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

Comment on lines +574 to +582
cmd_codex_start() {
ensure_init

local _log="$AIRC_WRITE_DIR/codex-airc.log"
"$AIRC_PYTHON" -m airc_core.codex_start \
--airc "$0" \
--home "$AIRC_WRITE_DIR" \
--log "$_log" \
-- "$@"
Comment on lines +578 to +590
"$AIRC_PYTHON" -m airc_core.codex_start \
--airc "$0" \
--home "$AIRC_WRITE_DIR" \
--log "$_log" \
-- "$@"

# Give the detached process a short startup window, then print the same
# useful local surfaces that `airc join` prints when it returns quickly.
sleep 2
echo ""
echo "Status"
echo "------"
cmd_status
Comment on lines +574 to +582
cmd_codex_start() {
ensure_init

local _log="$AIRC_WRITE_DIR/codex-airc.log"
"$AIRC_PYTHON" -m airc_core.codex_start \
--airc "$0" \
--home "$AIRC_WRITE_DIR" \
--log "$_log" \
-- "$@"
Comment on lines +42 to +43
proc = subprocess.Popen(
[args.airc, "join", *join_args],
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