Summary
The bundled agent-codex plugin launches Codex worker sessions as codex <prompt>. With the current Codex CLI, that enters the interactive CLI path rather than the non-interactive worker path. For unattended AO workers, the plugin should launch codex exec <prompt>.
Reproduction
Environment observed locally:
- AO CLI:
0.9.2
@aoagents/ao-plugin-agent-codex: 0.9.1
- Codex CLI: current npm-installed
@openai/codex
- Windows process runtime, project configured with
agent: codex
Steps:
- Configure a project with
agent: codex.
- Start AO:
ao start --no-dashboard --no-restore.
- Spawn a prompt worker:
ao spawn --agent codex --prompt "create a file and run tests"
- Inspect the spawned process command line.
Observed launch command before local patch:
codex -c check_for_update_on_startup=false --dangerously-bypass-approvals-and-sandbox ... -- '<prompt>'
The worker session was created, but Codex did not perform the requested headless work.
Expected behavior
AO should launch the Codex worker with the non-interactive Codex subcommand:
codex exec -c check_for_update_on_startup=false --dangerously-bypass-approvals-and-sandbox ... -- '<prompt>'
After locally patching the plugin to insert exec, the same AO smoke test spawned a Codex worker that created the requested file and ran npm test successfully.
Proposed fix
In packages/plugins/agent-codex/src/index.ts, initialize the launch command parts as:
const parts: string[] = [shellEscape(binary), "exec"];
and update the existing getLaunchCommand tests accordingly.
Summary
The bundled
agent-codexplugin launches Codex worker sessions ascodex <prompt>. With the current Codex CLI, that enters the interactive CLI path rather than the non-interactive worker path. For unattended AO workers, the plugin should launchcodex exec <prompt>.Reproduction
Environment observed locally:
0.9.2@aoagents/ao-plugin-agent-codex:0.9.1@openai/codexagent: codexSteps:
agent: codex.ao start --no-dashboard --no-restore.ao spawn --agent codex --prompt "create a file and run tests"Observed launch command before local patch:
The worker session was created, but Codex did not perform the requested headless work.
Expected behavior
AO should launch the Codex worker with the non-interactive Codex subcommand:
After locally patching the plugin to insert
exec, the same AO smoke test spawned a Codex worker that created the requested file and rannpm testsuccessfully.Proposed fix
In
packages/plugins/agent-codex/src/index.ts, initialize the launch command parts as:and update the existing
getLaunchCommandtests accordingly.