Phase 3 — Pilot provider. First non-Claude adapter; proves the seam end-to-end.
Scope
lib/agents/codex.sh:
- Build:
codex exec [prompt] (prompt via arg or stdin), --json (JSONL events),
-o/--output-last-message <file> for the final message, -m <model>, resume via
codex exec resume <id>, approval via -s <sandbox> / --dangerously-bypass-….
- Parse: map Codex JSONL events -> internal analysis struct (assistant/tool/result,
end-of-turn, usage if present, errors). Use --output-last-message for the final
answer; consider --output-schema for a structured RALPH_STATUS if helpful.
- Capabilities: structured=yes, token usage=verify, permission_denials=no(map to
sandbox/approval), api_limit_detection=codex-specific or off, session=resume-id.
- Unit tests via [P2.2] harness + an E2E with a mock codex CLI.
- Docs:
docs/providers/CODEX.md, README provider matrix row, .ralphrc notes.
Acceptance
ralph --provider codex runs the loop against a mock; exit detection works via
RALPH_STATUS; unsupported features degrade per [P2.1]. Full suite green.
Depends on: [P1.1], [P1.2], [P1.3], [P2.1], [P2.2]. Blocks: [P4.x] (as template).
Phase 3 — Pilot provider. First non-Claude adapter; proves the seam end-to-end.
Scope
lib/agents/codex.sh:codex exec [prompt](prompt via arg or stdin),--json(JSONL events),-o/--output-last-message <file>for the final message,-m <model>, resume viacodex exec resume <id>, approval via-s <sandbox>/--dangerously-bypass-….end-of-turn, usage if present, errors). Use
--output-last-messagefor the finalanswer; consider
--output-schemafor a structured RALPH_STATUS if helpful.sandbox/approval), api_limit_detection=codex-specific or off, session=resume-id.
docs/providers/CODEX.md, README provider matrix row,.ralphrcnotes.Acceptance
ralph --provider codexruns the loop against a mock; exit detection works viaRALPH_STATUS; unsupported features degrade per [P2.1]. Full suite green.Depends on: [P1.1], [P1.2], [P1.3], [P2.1], [P2.2]. Blocks: [P4.x] (as template).