Skip to content

feat: add Codex CLI support for delegate_task#61

Merged
priyanshujain merged 5 commits intomasterfrom
feat-codex-support
Mar 11, 2026
Merged

feat: add Codex CLI support for delegate_task#61
priyanshujain merged 5 commits intomasterfrom
feat-codex-support

Conversation

@priyanshujain
Copy link
Copy Markdown
Collaborator

Summary

  • Adds codex exec as the non-interactive invocation for OpenAI Codex CLI
  • Adds codex exec --json for streaming NDJSON output
  • Prompt is passed via stdin (same as Claude)

Test plan

  • TestAgentRunner_BuildsCodexArgs — verifies exec subcommand
  • TestStreamRunner_BuildsCodexStreamArgs — verifies exec --json args
  • Manual: install codex CLI, run delegate_task with agent: "codex"

Codex uses `exec` subcommand for non-interactive mode and `--json`
for streaming NDJSON output. Prompt is passed via stdin.
Use bare binary names instead of /usr/local/bin/ paths since these
are mock runners that never execute the binary.
Skips gracefully if codex is not installed or not authenticated.
parseStreamLine only handled Claude's format. Now handles:
- Gemini: {"type":"message","role":"assistant","content":"..."}
- Codex: {"type":"item.completed","item":{"type":"agent_message","text":"..."}}

Also adds streaming integration tests for Gemini and Codex,
gated on PATH detection and auth availability.
Unrecognized Gemini/Codex events (init, user messages, reasoning,
turn metadata) were leaking through with raw protocol type strings.
Now dropped to return only normalized text/result/tool_use events.

Also adds TestAgentRunner_CodexKeepsCLAUDECODE for env parity.
@priyanshujain priyanshujain merged commit 3265708 into master Mar 11, 2026
10 checks passed
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.

1 participant