Skip to content

Bug: codex-agent fails on Linux — script command syntax is macOS-only #5

@Sinha-Aditya

Description

@Sinha-Aditya

Bug Description

src/tmux.ts:79 uses macOS-only script syntax, causing codex-agent sessions to fail silently on Linux.

Current code:

const shellCmd = `script -q "${logFile}" codex ${codexArgs}; ...`;

The problem: The script command has different argument order on macOS vs Linux:

Platform Syntax
macOS (BSD) script -q <file> <command>
Linux (util-linux) script -q -c "<command>" <file>

On Linux, the current code causes script to interpret codex as the output filename and ${codexArgs} as the command, resulting in silent failure — the tmux session exits immediately without running codex.

Steps to Reproduce

  1. Install codex-orchestrator on a Linux machine (Ubuntu, etc.)
  2. Run any /codex-exec command via Claude Code
  3. Observe: tmux session starts but exits immediately, no codex output captured

Expected Behavior

Codex agent should launch correctly on both macOS and Linux.

Fix

Add process.platform detection to select the correct script syntax:

const isLinux = process.platform === "linux";
const shellCmd = isLinux
  ? `script -q -c "codex ${codexArgs}" "${logFile}"; ...`
  : `script -q "${logFile}" codex ${codexArgs}; ...`;

PR with the fix: incoming.

Environment

  • OS: Ubuntu (Linux 6.6.10)
  • Node: v22.17.0
  • Codex CLI: 0.101.0
  • codex-orchestrator: latest main

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