jido_codex is harness-first. Keep functionality focused on:
- implementing
Jido.Harness.Adapter - mapping Codex stream events into
Jido.Harness.Event - compatibility checks and minimal operational tasks
Avoid broad non-harness management wrappers.
- Namespace:
Jido.Codex.* - Runtime code location:
lib/jido_codex/ - Mix tasks location:
lib/mix/tasks/
Primary files:
lib/jido_codex.exlib/jido_codex/adapter.exlib/jido_codex/mapper.exlib/jido_codex/options.exlib/jido_codex/compatibility.exlib/jido_codex/session_registry.ex
Provider metadata lives under RunRequest.metadata["codex"].
Supported keys:
"transport":"exec"|"app_server""thread_id"/"resume_last""codex_opts"/"thread_opts"/"turn_opts""app_server"connect options"cancel_mode":"immediate"|"after_turn"
Precedence:
- runtime adapter opts > metadata > defaults derived from
RunRequest
- Always emit normalized
%Jido.Harness.Event{}. - Use canonical types first (
:session_started,:output_text_delta,:session_completed, etc.). - Use
:codex_*extensions for provider-specific semantics. - Include
provider: :codex, ISO-8601 timestamps, and raw passthrough. - Unknown events must safely fall back to
:codex_event.
- Use
Jido.Codex.Errorhelpers for structured errors. - Validate/normalize input via
Jido.Codex.Options(Zoi schema). - Do not crash on unknown metadata fields or unknown Codex events.
- Keep
mix testgreen with coverage >= 90%. - Integration tests must be tagged
:integrationand excluded by default. - Add unit coverage for mapper branches, option precedence, transport behavior, and cancellation paths.
Run before merging:
mix test
mix quality