Skip to content

Codex CLI crashes with SIGABRT when invoked through AutoAide shell spawn #3

@SparkssL

Description

@SparkssL

Bug Description

When sending a message through AutoAide's CLI shell, the underlying Codex CLI process crashes with SIGABRT, even though the exact same command works perfectly when run directly in the terminal.

Environment

  • OS: macOS (Apple Silicon / MacBook Air)
  • Node.js: v22+
  • Codex CLI: codex-cli 0.118.0
  • AutoAide: latest main branch
  • Shell: zsh (with conda base environment active)

Steps to Reproduce

  1. Install AutoAide: git clone && npm install && npm link
  2. Run autoaide and complete the bootstrap flow
  3. Type any message, e.g. hello
  4. Observe:
[autoaide> hello
Running on [main]...
autoaide>
Codex interrupted (SIGABRT).

Direct CLI Test (Works Fine)

Running the same underlying command manually succeeds:

$ echo "hello" | codex exec --skip-git-repo-check --json -
{"type":"thread.started","thread_id":"019d4a05-cbb3-7232-86a4-82d2bfe4b1a5"}
{"type":"turn.started"}
{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"Hello. What do you need?"}}
{"type":"turn.completed","usage":{"input_tokens":17226,"cached_input_tokens":3456,"output_tokens":70}}

Suspected Cause

In src/codex-runner.mjs, the command is spawned via zsh -lc:

spawn(shellSpec.command, [...shellSpec.args, command], {
  cwd,    // ~/.autoaide/workspace
  env: process.env,
  stdio: ["pipe", "pipe", "pipe"],
});

Possible causes:

  1. Workspace context injectionbuildWorkspacePrompt() prepends SOUL.md / IDENTITY.md / USER.md / TOOLS.md content via stdin. A malformed or overly large prompt may trigger the abort.
  2. CWD mismatch~/.autoaide/workspace may interact differently with Codex's internal path resolution vs a normal directory.
  3. Login shell interferencezsh -lc loads the full login profile (conda, nvm, etc.) which may set environment variables or aliases that conflict with Codex when spawned as a child process.
  4. Signal handling — The daemon or parent process management may inadvertently send signals to the Codex child process.

Suggested Investigation

  • Add error logging for stderr output of the spawned Codex process in codex-runner.mjs
  • Test with zsh -c instead of zsh -lc to rule out login shell profile issues
  • Log the exact prompt being piped to stdin to check for encoding or formatting issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions